Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
And I'd like to add domains to it (e.g. domain="[('date','=',time.strftime('%Y-%m-%d')),('state','=','done')]" ). I have tried making email templates using crm.phonecall.report.graph module, but with no success.
Managed to do it using API and Python. You can make it run daily/weekly/montly by using cron.(Im running this in an Ubuntu server)
# -*- coding: utf-8 -*-
from datetime import date
from xmlrpclib import ServerProxy
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
SERVER = 'SERVERADDRESS'
db = 'DBNAME'
user_id = 'admin'
password = 'password'
#Connecting to the server
server = ServerProxy(SERVER+'/xmlrpc/common')
uid = server.login(db, user_id, password)
server = ServerProxy(SERVER+'/xmlrpc/object')
start = 'today'
stop = 'tomorrow'
#returns a dictionary or False
query = server.execute_kw(db, uid, password,
#PARSE YOUR DATA
msg = MIMEMultipart('alternative')
COMMASPACE = ', '
people = ['firstname.lastname@example.org','email@example.com']
me = 'firstname.lastname@example.org'
msg['Subject'] = 'SUBJECT'
msg['From'] = me
msg['To'] = COMMASPACE.join(people)
html = """\
<body>Parsed data from the query goes here. You can use CSS.</body>
part1 = MIMEText(html, 'html')
# Send the message via our own SMTP server, but don't include the
# envelope header.
s = smtplib.SMTP('SMTPADDRESS')
s.sendmail('email@example.com', people, msg.as_string())
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 3/14/16, 5:30 AM|
|Seen: 407 times|
|Last updated: 5/16/16, 6:40 AM|