[FIX] contract: Changed modification_mail auto to appear like email and not internal comment

This commit is contained in:
Víctor Martínez
2021-01-20 09:54:30 +01:00
parent 42fc67846e
commit d3977be6f7
2 changed files with 35 additions and 17 deletions

View File

@@ -177,14 +177,15 @@ class ContractContract(models.Model):
)
if modification_ids_not_sent:
if not self.env.context.get('skip_modification_mail'):
record.message_post_with_template(
record.with_context(
default_subtype_id=self.env.ref(
'contract.mail_message_subtype_contract_modification'
).id,
).message_post_with_template(
self.env.ref(
"contract.mail_template_contract_modification"
).id,
notif_layout="contract.template_contract_modification",
subtype_id=self.env.ref(
'contract.mail_message_subtype_contract_modification'
).id
)
modification_ids_not_sent.write({'sent': True})