From 81c3afa894b1bdb1bbd410797d676beeab53181b Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Thu, 26 Apr 2018 11:44:16 +0200 Subject: [PATCH] mail_digest: display mail tracking values Prior to this change we could have digest messages w/ no content. Now we display mail tracking values if any. --- mail_digest/controllers/digest_layout_preview.py | 6 +++++- mail_digest/templates/digest_default.xml | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mail_digest/controllers/digest_layout_preview.py b/mail_digest/controllers/digest_layout_preview.py index f3abc871..2766a52b 100644 --- a/mail_digest/controllers/digest_layout_preview.py +++ b/mail_digest/controllers/digest_layout_preview.py @@ -92,7 +92,6 @@ class DigestPreview(http.Controller): msg.subtype_id = subtype subject, body = self._fake_content(subtype, i, x) msg.subject = subject - msg.body = body msg.message_type = random.choice( ('email', 'comment', 'notification')) msg.email_from = 'random@user%d.com' % i @@ -101,6 +100,11 @@ class DigestPreview(http.Controller): # relate a document msg.model = records._name msg.res_id = random.choice(records.ids) + # simulate messages w/ no body but tracking values + if x == random.choice([1, 2]): + msg.tracking_value_ids = self._fake_tracking_vals() + else: + msg.body = body messages += msg return messages diff --git a/mail_digest/templates/digest_default.xml b/mail_digest/templates/digest_default.xml index 4343b975..66c10f66 100644 --- a/mail_digest/templates/digest_default.xml +++ b/mail_digest/templates/digest_default.xml @@ -43,6 +43,18 @@
+ +

Changed values

+
    + +
  • + : + → + +
  • +
    +
+