summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_form.js
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2014-08-11 15:52:15 +0200
committerDenis Ledoux <dle@odoo.com>2014-08-11 15:58:02 +0200
commitae65be2b2ae98860f70a7e6f3d7679c40ea9bd93 (patch)
tree15529b8a6658361866b94af8616732f9c317ba0d /addons/web/static/src/js/view_form.js
parentc64b07736204c0f9f575ee167879ccbdf4603645 (diff)
parent0739bc4edabab7e74571087c01a2da68ccadb10e (diff)
[MERGE] forward port of branch saas-5 up to 0739bc4
Diffstat (limited to 'addons/web/static/src/js/view_form.js')
-rw-r--r--addons/web/static/src/js/view_form.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 41bc0447756..a90797335f3 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -5714,6 +5714,20 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
this._super.apply(this, arguments);
this.render_value();
this.set_filename('');
+ },
+ set_value: function(value_){
+ var changed = value_ !== this.get_value();
+ this._super.apply(this, arguments);
+ // By default, on binary images read, the server returns the binary size
+ // This is possible that two images have the exact same size
+ // Therefore we trigger the change in case the image value hasn't changed
+ // So the image is re-rendered correctly
+ if (!changed){
+ this.trigger("change:value", this, {
+ oldValue: value_,
+ newValue: value_
+ });
+ }
}
});