diff options
| author | Moens Alexandre <mao@odoo.com> | 2019-05-15 08:52:10 +0000 |
|---|---|---|
| committer | Moens Alexandre <mao@odoo.com> | 2019-05-22 06:47:37 +0000 |
| commit | 40a650a089af5311e8bfdd0384859a0bc67a6270 (patch) | |
| tree | e51b6c116d99fe09f12c81cff5dafcf5b99662c3 /addons/mail/static/src/js/chatter.js | |
| parent | 90dec44a286c69f31b3fbcf3302f16fdf90d4a5d (diff) | |
[FIX]mail: detach non existing element
This commit fixes a js crash that occured when the user was trying to
edit a new record while the chatter was not completely loaded
(this.field.thread.$el was not in the dom yet)
Behavior before this fix:
Traceback js & impossible to edit the form afterward.
Behavior after this fix:
no traceback, still possible to edit the form normally.
The thread will display on next chatter re-render. Could be forced by
triggering an onchange.
opw-1986061
closes odoo/odoo#33381
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/js/chatter.js')
| -rw-r--r-- | addons/mail/static/src/js/chatter.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index dc23354fe7b..635d261bf3f 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -139,7 +139,7 @@ var Chatter = Widget.extend({ if (this.fields.activity) { this.fields.activity.$el.detach(); } - if (this.fields.thread) { + if (this.fields.thread && this.fields.thread.$el ) { this.fields.thread.$el.detach(); } @@ -398,7 +398,7 @@ var Chatter = Widget.extend({ self.fields.followers.$el.insertBefore(self.$('.o_chatter_button_attachment')); } } - if (self.fields.thread) { + if (self.fields.thread && self.fields.thread.$el) { self.fields.thread.$el.appendTo(self.$el); } }).always(function () { |
