mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] contract: Prevent first contract modification mail to partner
This commit is contained in:
committed by
Jean-Charles Drubay
parent
3e288bbefe
commit
30417a789c
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Recurring - Contracts Management",
|
"name": "Recurring - Contracts Management",
|
||||||
"version": "13.0.2.3.0",
|
"version": "13.0.2.3.1",
|
||||||
"category": "Contract Management",
|
"category": "Contract Management",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "Tecnativa, ACSONE SA/NV, Odoo Community Association (OCA)",
|
"author": "Tecnativa, ACSONE SA/NV, Odoo Community Association (OCA)",
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ class ContractContract(models.Model):
|
|||||||
record.message_subscribe(
|
record.message_subscribe(
|
||||||
partner_ids=[record.partner_id.id], subtype_ids=[subtype_id.id]
|
partner_ids=[record.partner_id.id], subtype_ids=[subtype_id.id]
|
||||||
)
|
)
|
||||||
record.write(
|
record.with_context(skip_modification_mail=True).write(
|
||||||
{
|
{
|
||||||
"modification_ids": [
|
"modification_ids": [
|
||||||
(0, 0, {"date": date_start, "description": _("Contract start")})
|
(0, 0, {"date": date_start, "description": _("Contract start")})
|
||||||
@@ -161,13 +161,14 @@ class ContractContract(models.Model):
|
|||||||
lambda x: not x.sent
|
lambda x: not x.sent
|
||||||
)
|
)
|
||||||
if modification_ids_not_sent:
|
if modification_ids_not_sent:
|
||||||
record.message_post_with_template(
|
if not self.env.context.get("skip_modification_mail"):
|
||||||
self.env.ref("contract.mail_template_contract_modification").id,
|
record.message_post_with_template(
|
||||||
subtype_id=self.env.ref(
|
self.env.ref("contract.mail_template_contract_modification").id,
|
||||||
"contract.mail_message_subtype_contract_modification"
|
subtype_id=self.env.ref(
|
||||||
).id,
|
"contract.mail_message_subtype_contract_modification"
|
||||||
email_layout_xmlid="contract.template_contract_modification",
|
).id,
|
||||||
)
|
email_layout_xmlid="contract.template_contract_modification",
|
||||||
|
)
|
||||||
modification_ids_not_sent.write({"sent": True})
|
modification_ids_not_sent.write({"sent": True})
|
||||||
|
|
||||||
def _compute_access_url(self):
|
def _compute_access_url(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user