From a5dccc1586c0b0afd54690cfea56eb69687fcbf5 Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Fri, 21 Feb 2020 14:29:01 +0000 Subject: [PATCH] [REV] mail: Move the attachment icon on the left This revert of commit odoo/odoo@9cd3bcd4408be76168e1ab4c08f2d8e187096d79 is due to the attachment's button needing to be kept on the right side of the chatter's topbar. Task ID: 2193950 closes odoo/odoo#46958 X-original-commit: d458aca28c25879ca9878b0628f2a6ea703504ef Related: odoo/enterprise#9027 Signed-off-by: Pierre Paridans --- addons/mail/static/src/js/chatter.js | 7 +++++-- addons/mail/static/src/xml/chatter.xml | 22 ++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index ec2723f7878..92dbe515a27 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -96,6 +96,11 @@ var Chatter = Widget.extend({ */ start: function () { this._$topbar = this.$('.o_chatter_topbar'); + if(!this._disableAttachmentBox) { + this.$('.o_topbar_right_area').append(QWeb.render('mail.chatter.Attachment.Button', { + count: this.record.data.message_attachment_count || 0, + })); + } // render and append the buttons this._$topbar.prepend(this._renderButtons()); // start and append the widgets @@ -455,8 +460,6 @@ var Chatter = Widget.extend({ logNoteButton: this.hasLogButton, scheduleActivityButton: !!this.fields.activity, isMobile: config.device.isMobile, - disableAttachmentBox: this._disableAttachmentBox, - count: this.record.data.message_attachment_count || 0, }); }, /** diff --git a/addons/mail/static/src/xml/chatter.xml b/addons/mail/static/src/xml/chatter.xml index 8a7de19eda0..40e26a811b0 100644 --- a/addons/mail/static/src/xml/chatter.xml +++ b/addons/mail/static/src/xml/chatter.xml @@ -121,14 +121,20 @@ - - - + + + + +