fixup! [MIG] Migrate web_drop_target to 12.0

pull/1892/head
George Daramouskas 2019-10-09 17:30:35 +02:00 committed by Víctor Martínez
parent 6ddd71552e
commit 9fff39221e
1 changed files with 7 additions and 10 deletions

View File

@ -90,16 +90,13 @@ odoo.define('web_drop_target', function(require) {
], ],
}) })
.then(function() { .then(function() {
// try to find a sidebar and update it if we found one // find the chatter among the children, there should be only
var p = self; // one
while(p && !p.sidebar) { var res = _.filter(self.getChildren(), 'chatter')
p = p.getParent ? p.getParent() : null; if (res.length) {
} res[0].chatter._reloadAttachmentBox();
if (p) { res[0].chatter.trigger_up('reload');
var sidebar = p.sidebar; res[0].chatter.$('.o_chatter_button_attachment').click();
if (sidebar && _.isFunction(sidebar._onFileUploaded)) {
sidebar._onFileUploaded();
}
} }
}); });
}, },