[FIX] project: remove a traceback when moving a project to a stage with a with an email template

Steps to reproduce:
==============
1) Go to Project app and create a project A if you don't have any project.
2) Go to Project > Configuration > Settings.
3) Enable the "Project Stages" feature.
4) Go to Project > Configuration > Project Stages.
5) Show the Email template field in the list view and set a template on a stage. (create a stage before this step if none exists)
6) Go to the main view of Project App.
7) Move Project A to the stage with the template set.

Expected Behavior:
==============
The system should use the template for the mail tracking.

Current Behavior:
============
Traceback because the method `xmlid_to_res_id` does not exist in `ir.model.data`.

Task-2677199

closes odoo/odoo#78947

X-original-commit: 1d1eaad402dac523404296024f44d3c852ee1daf
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit is contained in:
Vincent Larcin
2021-10-26 07:47:55 +00:00
parent c14a7a4610
commit a06a99fb12
+1 -1
View File
@@ -559,7 +559,7 @@ class Project(models.Model):
if self.user_has_groups('project.group_project_stages') and 'stage_id' in changes and project.stage_id.mail_template_id:
res['stage_id'] = (project.stage_id.mail_template_id, {
'auto_delete_message': True,
'subtype_id': self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note'),
'subtype_id': self.env['ir.model.data']._xmlid_to_res_id('mail.mt_note'),
'email_layout_xmlid': 'mail.mail_notification_light',
})
return res