[FIX] mail: keep breadcrumb on click on chatter follower
authorDenis Ledoux <dle@odoo.com>
Thu, 2 Oct 2014 15:34:59 +0000 (17:34 +0200)
committerDenis Ledoux <dle@odoo.com>
Thu, 2 Oct 2014 15:35:27 +0000 (17:35 +0200)
addons/mail/static/src/js/mail_followers.js
addons/mail/static/src/xml/mail_followers.xml

index c103e4d..6d14355 100644 (file)
@@ -76,7 +76,8 @@ openerp_mail_followers = function(session, mail) {
             // event: click on 'edit_subtype(pencil)' button to edit subscription
             this.$el.on('click', '.oe_edit_subtype', self.on_edit_subtype);
             this.$el.on('click', '.oe_remove_follower', self.on_remove_follower);
-            this.$el.on('click', '.oe_show_more', self.on_show_more_followers)
+            this.$el.on('click', '.oe_show_more', self.on_show_more_followers);
+            this.$el.on('click', 'a[data-partner]', self.on_follower_clicked);
         },
 
         on_edit_subtype: function(event) {
@@ -136,6 +137,26 @@ openerp_mail_followers = function(session, mail) {
             }
         },
 
+        on_follower_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);
+        },
+
         read_value: function () {
             var self = this;
             this.displayed_nb = this.displayed_limit;
index 6e8682c..5a4d251 100644 (file)
@@ -30,7 +30,7 @@
         -->
     <div t-name="mail.followers.partner" class='oe_partner'>
         <img class="oe_mail_thumbnail oe_mail_frame" t-attf-src="{record.avatar_url}"/>
-        <a t-attf-href="#model=res.partner&amp;id=#{record.id}" t-att-title="record.name"><t t-esc="record.name"/></a>
+        <a t-attf-href="#model=res.partner&amp;id=#{record.id}" t-att-title="record.name" t-att-data-partner="record.id"><t t-esc="record.name"/></a>
         <span t-if="record.is_editable and (widget.records_length &gt; 1)" class="oe_edit_subtype oe_e oe_hidden" title="Edit subscription" t-att-data-id="record.id">&amp;</span>
         <span t-if="widget.view_is_editable" class="oe_remove_follower oe_e" title="Remove this follower" t-att-data-id="record.id">X</span>
     </div>