在 Odoo 16 中,邮件线程通知在自定义模块中调用。
if approver.user_id:
self._message_auto_subscribe_notify([approver.user_id.partner_id.id])
但是抛出错误,
模板的第二个参数和模板代码示例是什么?
在现有的addons项目>project.py中,是这样使用的:
class Project(models.Model):
_name = "project.project"
_description = "Project"
_inherit=['mail.alias.mixin','mail.thread', 'mail.activity.mixin']
# ...
# ...
self.message_notify(
subject=_('You have been assigned to %s', self.display_name),
body=assignation_msg,
partner_ids=user.partner_id.ids,
record_name=self.display_name,
email_layout_xmlid='mail.mail_notification_layout',
model_description=self_model_description,
mail_auto_delete=False,
)