[FIX] web: binary fields correctly resets
When uploading a file to a binary file, then clicking on the "clear" button, then reuploading the same file... Before this commit: The actual input of the field was only changed on user input. This means that the "clear" action didn't reset the actual value of the input, and the browser's default behaviour when getting the same path twice is not to change anything. In the use case, you couldn't upload the same file until you uploaded another one. After this commit: The "clear" action now also clears the value, allowing reuploading the same file over again. closes odoo/odoo#33843 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
This commit is contained in:
@@ -1228,6 +1228,7 @@ var AbstractFieldBinary = AbstractField.extend({
|
||||
}
|
||||
},
|
||||
on_clear: function () {
|
||||
this.$('.o_input_file').val('');
|
||||
this.set_filename('');
|
||||
this._setValue(false);
|
||||
this._render();
|
||||
|
||||
Reference in New Issue
Block a user