I need to send a messagge to another user when I create a task in a project and I select that user.
Example: I create a task for user "Sandro", I would like that Sandro receive a messagge that there is a task for him.
Use below python code in your add-on to send a message to user.
from openerp.osv import fields, osv
from openerp.tools.translate import _
_name = 'project.task'
def create(self, cr, uid, vals, context=None):
new_id = super(project_task, self).create(cr, uid, vals, context=context)
self.message_post(cr, uid, [new_id], body=_("Task Created"), subtype='mail.mt_comment', context=context)
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
|Asked: 1/8/16, 10:55 AM|
|Seen: 386 times|
|Last updated: 1/12/16, 10:54 AM|