diff options
| author | Denis Ledoux <dle@odoo.com> | 2014-08-11 15:30:37 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2014-08-11 15:30:37 +0200 |
| commit | 7ecaab9fe277b8442eb1bee2c8e91d4211387284 (patch) | |
| tree | f4fbd54a3106a3ee9c3b65c7fe51f299ebf2711f /addons/web/static/src | |
| parent | 576e3c776a74d6b807d60a612c643cbddcee97b3 (diff) | |
| parent | 2f4be42d8c6e3a6d3b46981c7e030e9e306cf646 (diff) | |
[MERGE] forward port of branch saas-3 up to 2f4be42
Diffstat (limited to 'addons/web/static/src')
| -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 27a67880168..a11f0a4e771 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5574,6 +5574,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_ + }); + } } }); |
