diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-10-14 17:17:41 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2015-10-16 15:52:02 +0200 |
| commit | be5fc7b1a4fe91272bc48d16068ad299aa6585ba (patch) | |
| tree | 24fd776a341566d3cb3832d66a0e1e99872751c0 /addons/mail/static/src/xml | |
| parent | 6ae0309b994ed4fc031f695f985972c1d0b0fd5c (diff) | |
[IMP] mail: redirect to DM on user clicked
When clicking on a partner in the thread of messages, it opens the DM with the
associated user if there is one (and if this user isn't the current user).
Otherwise, or when clicking on a record of any other model, the user is
redirected to that record's form view.
This change required a minor change in chat_manager: create_channel now
returns the created channel, as the client action needs it to switch to it.
Moreover, in the thread, when there is no partner associated with a message
(only an email address), we simply use html's mailto mechanism. This fixes a
bug as we formerly tried to open an unexisting record of res.partner.
Diffstat (limited to 'addons/mail/static/src/xml')
| -rw-r--r-- | addons/mail/static/src/xml/thread.xml | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml index 4fc96dc86e1..5678bb3e832 100644 --- a/addons/mail/static/src/xml/thread.xml +++ b/addons/mail/static/src/xml/thread.xml @@ -51,12 +51,20 @@ <t t-if="message.is_note"> Note by </t> - <t t-if="message.author_id && message.author_id[1]"> - <strong class="o_mail_redirect" data-oe-model="res.partner" t-att-data-oe-id="message.author_id[0]"><t t-esc="message.author_id[1]"/></strong> - </t> - <t t-if="!message.author_id || !message.author_id[1]"> - <strong class="o_mail_redirect"><t t-esc="message.displayed_author"/></strong> - </t> + + <strong t-if="message.mailto"> + <a class="o_mail_mailto" t-attf-href="mailto:#{message.mailto}?subject=Re: #{message.subject}"> + <t t-esc="message.mailto"/> + </a> + </strong> + <strong t-if="!message.mailto && message.author_id[0]" + data-oe-model="res.partner" t-att-data-oe-id="message.author_id[0]" + class="o_mail_redirect"> + <t t-esc="message.displayed_author"/> + </strong> + <strong t-if="!message.mailto && !message.author_id[0]"> + <t t-esc="message.displayed_author"/> + </strong> <small t-att-title="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('LLL')"> - <t t-esc="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('hh:mm A')"/> |
