Odoo Help


How to done Message menu notification?

aneesh ATEES Infomedia Pvt Ltd
on 8/14/15, 6:05 AM 846 views

i have a custome module like project .i need to assiagn work to employee and that user need to get notification in his message .menu or anywhere this is my requirement.how can solve it?pls explain the solution


Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.



Tarek Mohamed Ibrahim
On 8/14/15, 3:37 PM

You have first to set the outgoing mail server on your odoo settings and test it is working

You need also to create an email template to use when sending to employees

here is a code I used to send emails to employees when the status of a document is changed. Employees are assinged to users in the systme

    def mailing(self, cr, uid, ids,vals,context=None):
templates = self.pool.get('email.template').search(cr,uid,domain)
if not templates:
template = self.pool.get('email.template').browse(cr,uid,templates[0])
if template.email_to:
#template.body_html = 'this is a test for the x'
pr_id = self.browse(cr,uid,ids,context=context)[0].id
self.pool.get('email.template').send_mail(cr, uid, template.id, pr_id, True, context=context)
def write(self, cr, uid, ids, vals, context=None):
#for test only, comment when test succeeded
self.test = False
if self.test:
#for test only, comment when test succeeded

it is triggered in the write method of a view after changing the status of the document

Here is the email_to field and the body_html fields

Dear ${object.next_resp.name}, </p> <p> The document ${object.name} status has been changed to ${object.state}, pls check and take the appropriate action </p> 
this is the definition of next_resp field

        'next_resp':fields.many2one('res.users','Next responsible',),
and I'm using the email field in res.users.
I designed the code to save the user id in the 'next_resp' field that has to be notified when the document status is changed.

I posted my own solution, you have your own names and scenarios. I think this will be guide you for your similar case. You can add more specific questions in the comments until your solution work.

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/14/15, 6:05 AM
Seen: 846 times
Last updated: 8/17/15, 4:21 AM