mirror of https://github.com/OCA/social.git
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.pull/273/head
parent
2855b0ded2
commit
ef91aafbfb
|
@ -92,7 +92,6 @@ class DigestPreview(http.Controller):
|
||||||
msg.subtype_id = subtype
|
msg.subtype_id = subtype
|
||||||
subject, body = self._fake_content(subtype, i, x)
|
subject, body = self._fake_content(subtype, i, x)
|
||||||
msg.subject = subject
|
msg.subject = subject
|
||||||
msg.body = body
|
|
||||||
msg.message_type = random.choice(
|
msg.message_type = random.choice(
|
||||||
('email', 'comment', 'notification'))
|
('email', 'comment', 'notification'))
|
||||||
msg.email_from = 'random@user%d.com' % i
|
msg.email_from = 'random@user%d.com' % i
|
||||||
|
@ -101,6 +100,11 @@ class DigestPreview(http.Controller):
|
||||||
# relate a document
|
# relate a document
|
||||||
msg.model = records._name
|
msg.model = records._name
|
||||||
msg.res_id = random.choice(records.ids)
|
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
|
messages += msg
|
||||||
return messages
|
return messages
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,18 @@
|
||||||
<div class="message-wrapper"
|
<div class="message-wrapper"
|
||||||
t-attf-style="margin:0 10px;padding:5px 10px;#{not msg_first and 'border-top:1px solid #ccc'}">
|
t-attf-style="margin:0 10px;padding:5px 10px;#{not msg_first and 'border-top:1px solid #ccc'}">
|
||||||
<t t-raw="digest.message_body(msg)" />
|
<t t-raw="digest.message_body(msg)" />
|
||||||
|
<t t-if="msg.tracking_value_ids">
|
||||||
|
<h4>Changed values</h4>
|
||||||
|
<ul class="tracking-values">
|
||||||
|
<t t-foreach="msg.tracking_value_ids" t-as="tracked">
|
||||||
|
<li>
|
||||||
|
<strong class="fname"><span t-field="tracked.field_desc" />:</strong>
|
||||||
|
<span class="fvalue-old" t-esc="tracked.get_old_display_value()[0]" /> →
|
||||||
|
<span class="fvalue-new" t-esc="tracked.get_new_display_value()[0]" />
|
||||||
|
</li>
|
||||||
|
</t>
|
||||||
|
</ul>
|
||||||
|
</t>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue