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

Hi everyone. Is it possible to send notification to users' inbox or discuss in odoo 10 when an event occurs for example I want to send a notification to project manager(creator of budget) when a budget has been approved in odoo 10. I would like to do it in the model. Can anyone suggest how I can do it or share a link.

Thanks in advance

Regards

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

hello 

for send  the notification you can do like that in your method.

        self.env['mail.message'].create({'message_type':"notification",
                "subtype": self.env.ref("mail.mt_comment").id, # subject type
                'body': "Message body",
                'subject': "Message subject",
                'needaction_partner_ids': [(4, self.user_id.partner_id.id)], # partner to whom you send notification
                'model': self._name,
                'res_id': self.id,
                })
Ảnh đại diện
Huỷ bỏ

Hello,

Can you explain how to use it

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 20
3151
5
thg 12 19
12063
4
thg 1 19
4783
1
thg 1 19
8155
2
thg 1 19
10757