From bf6c805b66e4524c84868e8fe62ebe85d2221660 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?=
Date: Tue, 4 Jan 2022 10:31:48 +0000
Subject: [PATCH] [FIX] mail, *: add signature in email layouts only if
requested and set
* = account, purchase, sale
Purpose of this commit is to add signature only if really asked. A variable
is available for that purpose (``email_add_signature``, recently renamed from
``add_sign``). We also correctly check signature is not void or pseudo-void
using tool ``is_html_empty``. Indeed editor may generates pseudo-void content
like ``
``.
As signature is not added when a template is used (see composer code) we ensure
it is defined in mail templates used in "Send by email" flows. Indeed we cannot
know if a template already has a signature or not. To avoid having twice a
signature no signature is added in email notification layout when a template
is involved.
Continuation of odoo/odoo#76418 .
Task-2712450 (Mail/Sale: Improve 'Pay Now' notification template)
Part-of: odoo/odoo#82167
---
addons/account/data/mail_template_data.xml | 6 +++---
addons/mail/data/mail_templates_email_layouts.xml | 6 +++---
addons/purchase/data/mail_template_data.xml | 14 ++++++++++++++
addons/sale/data/mail_template_data.xml | 10 +++++++++-
4 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/addons/account/data/mail_template_data.xml b/addons/account/data/mail_template_data.xml
index 4ec06155817..4a6a17ec2a3 100644
--- a/addons/account/data/mail_template_data.xml
+++ b/addons/account/data/mail_template_data.xml
@@ -46,7 +46,7 @@
Do not hesitate to contact us if you have any questions.
-
+
--
Mitchell Admin
@@ -75,7 +75,7 @@
Do not hesitate to contact us if you have any questions.
Best regards,
-
+
--
Mitchell Admin
@@ -119,7 +119,7 @@
from YourCompany.
Do not hesitate to contact us if you have any questions.
-
+
--
Mitchell Admin
diff --git a/addons/mail/data/mail_templates_email_layouts.xml b/addons/mail/data/mail_templates_email_layouts.xml
index 75a6b3ba426..c339ac8889c 100644
--- a/addons/mail/data/mail_templates_email_layouts.xml
+++ b/addons/mail/data/mail_templates_email_layouts.xml
@@ -49,7 +49,7 @@
: ->
-
+
Sent
@@ -177,12 +177,12 @@
-
+
Best regards,
-
+
diff --git a/addons/purchase/data/mail_template_data.xml b/addons/purchase/data/mail_template_data.xml
index bdd1a4fc9cf..31573688f43 100644
--- a/addons/purchase/data/mail_template_data.xml
+++ b/addons/purchase/data/mail_template_data.xml
@@ -23,6 +23,10 @@
If you have any questions, please do not hesitate to contact us.
Best regards,
+
+
+ --
Mitchell Admin
+
@@ -56,6 +60,11 @@
Could you please acknowledge the receipt of this order?
+
+
+ --
Mitchell Admin
+
+
@@ -90,6 +99,11 @@
undefined.
Could you please confirm it will be delivered on time?
+
+
+ --
Mitchell Admin
+
+
diff --git a/addons/sale/data/mail_template_data.xml b/addons/sale/data/mail_template_data.xml
index 481187503a8..d84e9f8239c 100644
--- a/addons/sale/data/mail_template_data.xml
+++ b/addons/sale/data/mail_template_data.xml
@@ -30,7 +30,11 @@
Do not hesitate to contact us if you have any questions.
-
+
+
+ --
Mitchell Admin
+
+
@@ -65,6 +69,10 @@
Do not hesitate to contact us if you have any questions.
+
+
+ --
Mitchell Admin
+