From 7ccd8fdcc7dc028ab4b6def0d7b872e4892a8ff7 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 23 May 2014 15:54:43 +0200 Subject: [PATCH] [FIX] mail: push to breadcrumb on subject, author or notified partners links click opw-608251: When coming from website > My account, and clicking on a lead link from a message in the inbox, and then deleting the lead, the history_back is triggered and we come back in the website, while we should have come back in the inbox. This is because the action performed was not pushed in the breadcrumb --- addons/mail/static/src/js/mail.js | 30 ++++++++++++++++++++++++++++++ addons/mail/static/src/xml/mail.xml | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 17dd4b5..9bc3957 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -922,15 +922,45 @@ openerp.mail = function (session) { this.$('.oe_mail_expand').on('click', this.on_expand); this.$('.oe_mail_reduce').on('click', this.on_expand); this.$('.oe_mail_action_model').on('click', this.on_record_clicked); + this.$('.oe_mail_action_author').on('click', this.on_record_author_clicked); }, on_record_clicked: function (event) { + event.preventDefault(); + var self = this; var state = { 'model': this.model, 'id': this.res_id, 'title': this.record_name }; session.webclient.action_manager.do_push_state(state); + this.context.params = { + model: this.model, + res_id: this.res_id, + }; + this.thread.ds_thread.call("message_redirect_action", {context: this.context}).then(function(action){ + self.do_action(action); + }); + }, + + on_record_author_clicked: function (event) { + event.preventDefault(); + var partner_id = $(event.target).data('partner'); + var state = { + 'model': 'res.partner', + 'id': partner_id, + 'title': this.record_name + }; + session.webclient.action_manager.do_push_state(state); + var action = { + type:'ir.actions.act_window', + view_type: 'form', + view_mode: 'form', + res_model: 'res.partner', + views: [[false, 'form']], + res_id: partner_id, + } + this.do_action(action); }, /* Call the on_compose_message on the thread of this message. */ diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 28cbbca..2a4ac8d 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -284,7 +284,7 @@
- + updated document @@ -304,7 +304,7 @@ - + , -- 1.7.10.4