Skip to content
Snippets Groups Projects
Commit d5d0a9fd authored by Nicolas (vin)'s avatar Nicolas (vin)
Browse files

[IMP] account: allow trying to upload the same file

Since https://github.com/odoo/odoo/commit/cb6c6224be4eaa80091f51f957059de889332e68


we are now raising possible errors when uploading an invoice.
In 14.0+ we are allowing via a redirect warning to change the status of
the currency without changing the page but the upload only starts when
you change the uploaded file.
So the following flow does not work:
    - Try to upload a bill with MXN currency
    - With MXN being inactive, it raises an error. Using the redirect warning action
      we activate the currency, clos the modale window and try to upload
      again.
    - The upload won't work until we refresh the page, because the value
      of the input file does not change (or we need to select another
      one, then the first one again)
This change reset the file input if there is an error raised during the
upload allowing to select the same file more than once without reloading.

closes odoo/odoo#86517

X-original-commit: 4bfc7507
Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
parent 72904675
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,9 @@ odoo.define('account.upload.bill.mixin', function (require) {
context: this.initialState.context,
}).then(function(result) {
self.do_action(result);
}).catch(function () {
// Reset the file input, allowing to select again the same file if needed
self.$('.o_vendor_bill_upload .o_input_file').val('');
});
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment