Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] base_substate: migrate track_template function #982

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 _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
Loading