[FIX] web: image fields re-render on next/previous
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
This commit is contained in:
parent
2b0487113a
commit
3632949cff
|
@ -5194,6 +5194,20 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
this.render_value();
|
this.render_value();
|
||||||
this.set_filename('');
|
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_
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue