fix migraiton of mail_usability
This commit is contained in:
@@ -10,4 +10,9 @@
|
|||||||
<field name="body_html">${object.body | safe}</field>
|
<field name="body_html">${object.body | safe}</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<template id="message_notification_email_usability">
|
||||||
|
<div t-raw="message.body"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ class MailThread(models.AbstractModel):
|
|||||||
_logger.debug('Skip automatic subscribe notification')
|
_logger.debug('Skip automatic subscribe notification')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _message_auto_subscribe_notify(self, partner_ids):
|
def _message_auto_subscribe_notify(self, partner_ids, template):
|
||||||
if self._active_message_auto_subscribe_notify():
|
if self._active_message_auto_subscribe_notify():
|
||||||
return super(MailThread, self)._message_auto_subscribe_notify(
|
return super(MailThread, self)._message_auto_subscribe_notify(
|
||||||
partner_ids)
|
partner_ids, template)
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@@ -13,16 +13,15 @@ class ResPartner(models.Model):
|
|||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _notify(self, message, rdata, record, force_send=False,
|
def _notify(self, message, rdata, record, force_send=False,
|
||||||
send_after_commit=True, model_description=False,
|
send_after_commit=True, model_description=False,
|
||||||
mail_auto_delete=True):
|
mail_auto_delete=True):
|
||||||
# use an empty layout for notification by default
|
# use an empty layout for notification by default
|
||||||
if not self._context.get('custom_layout'):
|
if not message.layout:
|
||||||
self = self.with_context(
|
message.layout = 'mail_usability.message_notification_email_usability'
|
||||||
custom_layout='mail_usability.mail_template_notification')
|
|
||||||
# Never auto delete notification email
|
# Never auto delete notification email
|
||||||
# fucking to hard to debug when message have been delete
|
# fucking to hard to debug when message have been delete
|
||||||
mail_auto_delete = False
|
mail_auto_delete = False
|
||||||
return super(ResPartner, self)._notify(
|
return super(ResPartner, self)._notify(
|
||||||
message=message, rdata=rdata, record=record,
|
message=message, rdata=rdata, record=record,
|
||||||
force_send=force_send, send_after_commit=send_after_commit,
|
force_send=force_send, send_after_commit=send_after_commit,
|
||||||
model_description=model_description, mail_auto_delete=mail_auto_delete)
|
model_description=model_description, mail_auto_delete=mail_auto_delete)
|
||||||
|
|||||||
Reference in New Issue
Block a user