fixup! [MIG] Migrate web_drop_target to 12.0

pull/1393/head
George Daramouskas 2019-10-09 17:30:35 +02:00
parent dc67c12be6
commit ca2e3b5964
No known key found for this signature in database
GPG Key ID: 5B4EF742F8CD859C
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();
}
} }
}); });
}, },