跳至內容
選單
此問題已被標幟
2 回覆
4435 瀏覽次數

Hi all,

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.

Kind regards    

頭像
捨棄
作者 最佳答案

thank you... in which add on?

頭像
捨棄
最佳答案

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 _
class project_task(osv.osv):
_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)
return new_id

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
5
8月 23
4093
1
3月 15
5406
4
8月 20
4082
5
3月 16
4377
2
2月 16
6130