summaryrefslogtreecommitdiff
path: root/addons/im_support/static/src/js/support_message.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2018-06-21 11:07:30 +0200
committerAlexandre Kühn <aku@odoo.com>2018-07-02 15:12:31 +0200
commit01bf6f4383d1e7aa9b7d8c255ba8875f5a85609f (patch)
tree51f5549c2c943cf76bc7d0a9a8f29f061f1217e9 /addons/im_support/static/src/js/support_message.js
parented79f533a6d3373a90db2e1bf6e1095dbb086722 (diff)
[FIX] im_support: support message init()
Service calls only work when the parent and event dispatcher mixing is set. In this case, this is after the `_super` call.
Diffstat (limited to 'addons/im_support/static/src/js/support_message.js')
-rw-r--r--addons/im_support/static/src/js/support_message.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/addons/im_support/static/src/js/support_message.js b/addons/im_support/static/src/js/support_message.js
index df03d0fa477..bf21bd2624f 100644
--- a/addons/im_support/static/src/js/support_message.js
+++ b/addons/im_support/static/src/js/support_message.js
@@ -11,23 +11,19 @@ var session = require('web.session');
var SupportMessage = Message.extend({
/**
* @override
- * @param {Class} parent
- * @param {Object} data
- * @param {Array} [data.author_id=[]]
*/
- init: function (parent, data) {
- data.author_id = data.author_id || [];
- if (data.author_id !== this.call('mail_service', 'getOdoobotID')) {
- if (!data.author_id[0]) {
+ init: function () {
+ this._super.apply(this, arguments);
+ if (this._serverAuthorID !== this.call('mail_service', 'getOdoobotID')) {
+ if (!this._serverAuthorID[0]) {
// the author is the client
- data.author_id = [session.partner_id, session.name];
+ this._serverAuthorID = [session.partner_id, session.name];
} else {
// the author is the operator
// prevent from conflicting with partners of this instance
- data.author_id[0] = -1;
+ this._serverAuthorID[0] = -1;
}
}
- this._super.apply(this, arguments);
},
//--------------------------------------------------------------------------