From ca2e3b5964b58f9400ab13117e8cc1c6dda12362 Mon Sep 17 00:00:00 2001 From: George Daramouskas Date: Wed, 9 Oct 2019 17:30:35 +0200 Subject: [PATCH] fixup! [MIG] Migrate web_drop_target to 12.0 --- .../static/src/js/web_drop_target.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/web_drop_target/static/src/js/web_drop_target.js b/web_drop_target/static/src/js/web_drop_target.js index 4f9c5ed57..43bfeb1f8 100644 --- a/web_drop_target/static/src/js/web_drop_target.js +++ b/web_drop_target/static/src/js/web_drop_target.js @@ -90,16 +90,13 @@ odoo.define('web_drop_target', function(require) { ], }) .then(function() { - // try to find a sidebar and update it if we found one - var p = self; - while(p && !p.sidebar) { - p = p.getParent ? p.getParent() : null; - } - if (p) { - var sidebar = p.sidebar; - if (sidebar && _.isFunction(sidebar._onFileUploaded)) { - sidebar._onFileUploaded(); - } + // find the chatter among the children, there should be only + // one + var res = _.filter(self.getChildren(), 'chatter') + if (res.length) { + res[0].chatter._reloadAttachmentBox(); + res[0].chatter.trigger_up('reload'); + res[0].chatter.$('.o_chatter_button_attachment').click(); } }); },