Skip to content

Commit

Permalink
[FIX] base_substate: migrate track_template function
Browse files Browse the repository at this point in the history
Note that because inheritance was poorly implemented in inheriting modules
(such as sale_substate) this function was never called, hiding the bug.

auto_delete_message was removed in odoo@9140ce06
  • Loading branch information
len-foss committed Dec 12, 2024
1 parent 1be5f5a commit af4e485
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions base_substate/models/base_substate_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ def check_substate_id_value(self):
}
)

def _track_template(self, tracking):
res = super()._track_template(tracking)
first_rec = self[0]
changes, tracking_value_ids = tracking[first_rec.id]
if "substate_id" in changes and first_rec.substate_id.mail_template_id:
def _track_template(self, changes):
res = super()._track_template(changes)
track = self[0]

Check warning on line 33 in base_substate/models/base_substate_mixin.py

View check run for this annotation

Codecov / codecov/patch

base_substate/models/base_substate_mixin.py#L32-L33

Added lines #L32 - L33 were not covered by tests
if "substate_id" in changes and track.substate_id.mail_template_id:
res["substate_id"] = (
first_rec.substate_id.mail_template_id,
track.substate_id.mail_template_id,
{
"auto_delete_message": True,
"subtype_id": self.env["ir.model.data"].xmlid_to_res_id(
"composition_mode": "comment",
"auto_delete": True,
"subtype_id": self.env["ir.model.data"]._xmlid_to_res_id(
"mail.mt_note"
),
"notif_layout": "mail.mail_notification_light",
"email_layout_xmlid": "mail.mail_notification_light",
},
)
return res
Expand Down

0 comments on commit af4e485

Please sign in to comment.