@api.multi
def _message_auto_subscribe_notify(self, partner_ids):
""" Notify newly subscribed followers of the last posted message.
:param partner_ids : the list of partner to add as needaction partner of the last message
(This excludes the current partner)
"""
if not partner_ids:
return
if self.env.context.get('mail_auto_subscribe_no_notify'):
return
# send the email only to the current record and not all the ids matching active_domain !
# by default, send_mail for mass_mail use the active_domain instead of active_ids.
if 'active_domain' in self.env.context:
ctx = dict(self.env.context)
ctx.pop('active_domain')
self = self.with_context(ctx)
for record in self:
record.message_post_with_view(
'mail.message_user_assigned',
composition_mode='mass_mail',
partner_ids=[(4, pid) for pid in partner_ids],
auto_delete=True,
auto_delete_message=True,
parent_id=False, # override accidental context defaults
subtype_id=self.env.ref('mail.mt_note').id)
您可以在模块
mail
,文件夹views
,文件mail_templates.xml
中找到该通知。在您要查找的模板的XML ID是
message_user_assigned
。在在同一个模块中,文件夹
models
,文件mail_thread.py
,有一个发送通知的操作:在您的案例中执行此操作是因为}模型继承自
^{pr2}$sale.order
和{mail.thread
:我不建议您删除},则什么也不做。在
_inherit
。我认为最好重写_message_auto_subscribe_notify
方法来检查活动模型,如果这是sale.order
或{相关问题 更多 >
编程相关推荐