diff options
| author | Denis Ledoux <dle@odoo.com> | 2014-08-11 15:31:04 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2014-08-11 15:31:04 +0200 |
| commit | 0739bc4edabab7e74571087c01a2da68ccadb10e (patch) | |
| tree | dae48480436a1e225867bb2d41852427dac087f2 /addons/web/static/src/js | |
| parent | 7c647ec8768845d387da3bc3792b338b9144b395 (diff) | |
| parent | 7ecaab9fe277b8442eb1bee2c8e91d4211387284 (diff) | |
[MERGE] forward port of branch saas-4 up to 7ecaab9
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 14 |
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 5dc160f78f5..02f73b47ab0 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5684,6 +5684,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_ + }); + } } }); |
