[MIG] web_send_message_popup: Migration to 14.0

This commit is contained in:
hkapatel
2021-07-09 14:20:56 +05:30
committed by Du-ma
parent 3f1cbf9750
commit f4a8966e3f
3 changed files with 20 additions and 9 deletions

View File

@@ -1,17 +1,27 @@
/* Copyright 2019-2021 Camptocamp SA
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define("web_send_message_popup.Chatter", function (require) {
odoo.define("web_send_message_popup/static/src/js/chatter.js", function (require) {
"use strict";
var Chatter = require("mail.Chatter");
const components = {
Composer: require("mail/static/src/components/chatter_topbar/chatter_topbar.js"),
};
const {patch} = require("web.utils");
Chatter.include({
_onOpenComposerMessage: function () {
patch(components.Composer, "web_send_message_popup/static/src/js/chatter.js", {
/**
* Overwrite to always launch full composer instead of quick messages
*/
_onClickSendMessage() {
this._super.apply(this, arguments);
var self = this;
this._suggestedPartnersProm.then(function () {
self._composer._onOpenFullComposer();
});
if (
this.chatter.composer &&
this.chatter.isComposerVisible &&
!this.chatter.composer.isLog
) {
this.chatter.update({isComposerVisible: false});
this.chatter.composer.openFullComposer();
}
},
});
});