[FIX] web: onchange on field binary
If a onchange is set on a binary field, the name of the file (filename attribute defined in the view) is still the name of the previous file. Fixes #2427, opw 617109
This commit is contained in:
parent
6262e3479b
commit
f8a2a64ade
|
@ -5721,10 +5721,10 @@ instance.web.form.FieldBinaryFile = instance.web.form.FieldBinary.extend({
|
|||
},
|
||||
on_file_uploaded_and_valid: function(size, name, content_type, file_base64) {
|
||||
this.binary_value = true;
|
||||
this.set_filename(name);
|
||||
this.internal_set_value(file_base64);
|
||||
var show_value = name + " (" + instance.web.human_size(size) + ")";
|
||||
this.$el.find('input').eq(0).val(show_value);
|
||||
this.set_filename(name);
|
||||
},
|
||||
on_clear: function() {
|
||||
this._super.apply(this, arguments);
|
||||
|
|
Loading…
Reference in New Issue