summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorLuc De Meyer <luc.demeyer@noviat.com>2015-04-20 16:42:15 +0200
committerMartin Trigaux <mat@odoo.com>2015-04-20 16:42:15 +0200
commitf8a2a64ade5eb98a5a70dcf4b2ca5669f1291354 (patch)
treeaba86f2ce829091fea5e3c938f89091f6179d1eb /addons/web/static/src
parent6262e3479b409a18b8ea1e59a80297b74f17ba6d (diff)
[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
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/view_form.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 4f4dd2a787d..3c45896d409 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -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);