From 75979fccdff49723314ad76d576e65df570de740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 3 Jan 2022 14:01:09 +0000 Subject: [PATCH] [REF] mail, *: improve 'pay now' notification template * = sale, purchase PURPOSE Purpose of this commit is to improve the 'Pay Now' notification template used notably when using the "Send by email" button on * invoices * sale orders * RFQ and purchase orders SPECIFICATIONS Global specifications * remove gray background that is around the white content (aka have an email with an uniform white background); * move button on top of email like other notification templates (top-left and company logo is top-right); * fix various small wording issues; * fix signature usage; Technical specifications Remove custom definition of access links and labels in 'Pay Now' notification template (``mail_notification_paynow``). It is now done at model level through the ``_notify_get_groups`` that is generic to notification emails. This allows to remove QWeb override in purchase and sale notably. Displaying access links is now controller by the ``has_button_access`` value. Model computes links, access and labels while view only displays what is requested. That way any template can use those values instead of being defined in a template subject to user changes. Sale / Purchase Overrides of those modules is not necessary anymore since button labelling and URLs are managed at model level. Purchase "specific" buttons for Accept / Update dates are now email layout actions, like used in other modules like HR or Project. Continuation of odoo/odoo#76418 . Task-2712450 (Mail/Sale: Improve 'Pay Now' notification template) Part-of: odoo/odoo#82167 --- .../data/mail_templates_email_layouts.xml | 52 +++++++++---------- addons/portal/models/portal_mixin.py | 14 +++-- addons/purchase/data/mail_templates.xml | 35 ------------- addons/purchase/models/purchase.py | 21 ++++++++ addons/sale/__manifest__.py | 1 - addons/sale/data/mail_templates.xml | 27 ---------- addons/sale/models/sale_order.py | 26 ++++++++++ addons/test_mail/models/test_mail_models.py | 5 -- .../tests/test_website_sale_mail.py | 2 + 9 files changed, 84 insertions(+), 99 deletions(-) delete mode 100644 addons/sale/data/mail_templates.xml diff --git a/addons/mail/data/mail_templates_email_layouts.xml b/addons/mail/data/mail_templates_email_layouts.xml index c339ac8889c..e7e5ca38898 100644 --- a/addons/mail/data/mail_templates_email_layouts.xml +++ b/addons/mail/data/mail_templates_email_layouts.xml @@ -131,33 +131,37 @@ - +