Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4438 Lượt xem

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    

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

thank you... in which add on?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
5
thg 8 23
4094
1
thg 3 15
5407
4
thg 8 20
4082
5
thg 3 16
4378
2
thg 2 16
6131