summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-12-01 08:58:28 +0100
committerAaron Bohy <aab@odoo.com>2015-12-03 11:21:47 +0100
commite7cb3dcaa8a26b254a78d07cb0eb95946440edaa (patch)
treeaa1830b8d2e9a73592b42a02e862a6cc374d5b2a /addons/mail/static/src/js
parent33ac65c805c30fafac4e2cf5490c57c7eaf74b4a (diff)
[FIX] mail: don't redirect to user's own partner form view
Clicking on the author of a message opens a DM with the corresponding user if there is one, and opens the corresponding partner's form view otherwise. When the author is the current user, obviously we don't want to open a DM with ourself, but we probably don't want to open our partner form view either, which was exactly the behavior before this rev.
Diffstat (limited to 'addons/mail/static/src/js')
-rw-r--r--addons/mail/static/src/js/chat_manager.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js
index adf1b5f6b57..c9cf65ac883 100644
--- a/addons/mail/static/src/js/chat_manager.js
+++ b/addons/mail/static/src/js/chat_manager.js
@@ -148,6 +148,13 @@ function make_message (data) {
msg.email_from || _t('Anonymous');
}
+ // Don't redirect on author clicked of self-posted messages
+ if (msg.author_id && msg.author_id[0] === session.partner_id) {
+ msg.author_redirect = false;
+ } else {
+ msg.author_redirect = true;
+ }
+
// Compute the avatar_url
if (msg.author_id && msg.author_id[0]) {
msg.avatar_src = "/web/image/res.partner/" + msg.author_id[0] + "/image_small";