mirror of https://github.com/OCA/web.git
[IMP] web_drop_target: Make sure is a Blob object
Make sure that when a File is dropped into a form the event is propagated and the action only takes place when the element dropped is actually a Blob object. Taken from #1209 Co-Authored-By: George Daramouskas <daramousk@users.noreply.github.com>pull/2139/head
parent
6bf9789db4
commit
0aba413c93
|
@ -110,6 +110,9 @@ odoo.define('web_drop_target', function(require) {
|
|||
) {
|
||||
var self = this;
|
||||
var file = item;
|
||||
if(!file || !(file instanceof Blob)) {
|
||||
return;
|
||||
}
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = self.proxy(
|
||||
_.partial(self._create_attachment, file, reader, e, res_model, res_id, extra_data)
|
||||
|
|
Loading…
Reference in New Issue