summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Paridans <app@odoo.com>2020-02-21 14:29:01 +0000
committerPierre Paridans <app@odoo.com>2020-03-05 11:40:01 +0000
commita5dccc1586c0b0afd54690cfea56eb69687fcbf5 (patch)
treec0d6b2836c2c3a8c1cc53cb0a53c791c93d234ca
parent80c00af329b9edea33f388dacb3e4da74bdc579b (diff)
[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 <pparidans@users.noreply.github.com>
-rw-r--r--addons/mail/static/src/js/chatter.js7
-rw-r--r--addons/mail/static/src/xml/chatter.xml22
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 @@
<button t-if="scheduleActivityButton" class="btn btn-link o_chatter_button_schedule_activity" title="Log or schedule an activity" disabled="disabled">
<i class="fa fa-clock-o" role="img" aria-label="Dates" title="Dates"/> <t t-if="isMobile">Activity</t><t t-else="">Schedule activity</t>
</button>
- <t t-if="!disableAttachmentBox">
- <button class="btn btn-link o_chatter_button_attachment" title="View all the attachments of the current record">
- <span>
- <i class="fa fa-paperclip"/>
- <span class="o_chatter_attachment_button_count" t-esc="count"/>
- </span>
- </button>
- </t>
+ </t>
+
+ <!--
+ Chatter attachment paperclip button.
+
+ @param {integer} [count]
+ -->
+ <t t-name="mail.chatter.Attachment.Button">
+ <button class="btn btn-link o_chatter_button_attachment" title="View all the attachments of the current record">
+ <span>
+ <i class="fa fa-paperclip"/>
+ <span class="o_chatter_attachment_button_count" t-esc="count"/>
+ </span>
+ </button>
</t>
<!--