[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:
Luc De Meyer 2015-04-20 16:42:15 +02:00 committed by Martin Trigaux
parent 6262e3479b
commit f8a2a64ade
1 changed files with 1 additions and 1 deletions

View File

@ -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);