From 03c4eae63b7b7133d362ff7b9f3e90119c820393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 17 Nov 2020 12:39:09 +0000 Subject: [PATCH] [MOV][IMP] mrp, repair: reorganize qweb / jinja templates used for mailing PURPOSE Clean organization of templates in odoo apps: mail.template records in data, qweb templates (views) used directly in code, notably using post with view. Purpose is to ease future improvements in posting based on templates. SPECIFICATIONS * move those templates in their own file to ease their discovering and maintenance; * put them into data (as those are not views even if it contains qweb) * guidelines are now : -> Qweb templates should be in data/mail_templates.xml; -> mail.template records should be in data/mail_template_data.xml; * put their declaration in no update when not done if template has no technical code or complex dependency on underlying code; * move found mail data (mail.message.subtype or mail.activity.type) records in a mail_data file that should contain only "core" records linked to mail; LINKS Task ID-2375767 COM PR odoo/odoo#61814 ENT PR odoo/enterprise#14775 UPG PR odoo/upgrade#1936 --- addons/mrp/__manifest__.py | 3 +- addons/mrp/data/mail_templates.xml | 53 +++++++++++++++++++ .../mrp/report/mrp_production_templates.xml | 17 ------ .../views/{mrp_templates.xml => assets.xml} | 35 ------------ addons/repair/__manifest__.py | 2 +- ...repair_data.xml => mail_template_data.xml} | 0 6 files changed, 56 insertions(+), 54 deletions(-) create mode 100644 addons/mrp/data/mail_templates.xml rename addons/mrp/views/{mrp_templates.xml => assets.xml} (54%) rename addons/repair/data/{repair_data.xml => mail_template_data.xml} (100%) diff --git a/addons/mrp/__manifest__.py b/addons/mrp/__manifest__.py index 2be559a112e..9da53684c4f 100644 --- a/addons/mrp/__manifest__.py +++ b/addons/mrp/__manifest__.py @@ -15,6 +15,7 @@ 'security/mrp_security.xml', 'security/ir.model.access.csv', 'data/digest_data.xml', + 'data/mail_templates.xml', 'data/mrp_data.xml', 'wizard/change_production_qty_views.xml', 'wizard/mrp_workcenter_block_view.xml', @@ -36,7 +37,7 @@ 'views/mrp_unbuild_views.xml', 'views/ir_attachment_view.xml', 'views/res_config_settings_views.xml', - 'views/mrp_templates.xml', + 'views/assets.xml', 'views/stock_scrap_views.xml', 'report/report_deliveryslip.xml', 'report/mrp_report_views_main.xml', diff --git a/addons/mrp/data/mail_templates.xml b/addons/mrp/data/mail_templates.xml new file mode 100644 index 00000000000..bcce9792c8a --- /dev/null +++ b/addons/mrp/data/mail_templates.xml @@ -0,0 +1,53 @@ + + + + + + + + diff --git a/addons/mrp/report/mrp_production_templates.xml b/addons/mrp/report/mrp_production_templates.xml index 650123b8e35..42a4f61bdc4 100644 --- a/addons/mrp/report/mrp_production_templates.xml +++ b/addons/mrp/report/mrp_production_templates.xml @@ -184,21 +184,4 @@ - - - - diff --git a/addons/mrp/views/mrp_templates.xml b/addons/mrp/views/assets.xml similarity index 54% rename from addons/mrp/views/mrp_templates.xml rename to addons/mrp/views/assets.xml index 713b71cfbc6..e3e70ccfad1 100644 --- a/addons/mrp/views/mrp_templates.xml +++ b/addons/mrp/views/assets.xml @@ -31,39 +31,4 @@