From a06a99fb1293472eb6bc57bb6444acf27722efc8 Mon Sep 17 00:00:00 2001 From: Vincent Larcin Date: Mon, 25 Oct 2021 12:33:54 +0000 Subject: [PATCH] [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) --- addons/project/models/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 089d67ab8fc..59f3e02f281 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -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