odoo/odoo#192536

Created by Bugfix, Anh Thao Pham (pta)
Merged at 4f8a6b4d4ccddd9a393dd90aaee26f21c983c9a2

Statuses:

label
odoo-dev:17.0-opw-4325310-fix_thousands_separator_import_bank_statement-pta
head
39f2d42b45693bbf35c7aeb96ad36ec6e805633a
merged
8 months ago by SM Learn, Julien Castiaux (juc)
odoo/odoo
17.0 #192536
saas-17.4 #198924
18.0 #198928
saas-18.1 #198934
saas-18.2 #198935
saas-18.3
saas-18.4
19.0
master #198937

[FIX] base_import: fix selector with an empty string

Steps to reproduce:
- Install Accounting
- On Accounting dashboard, click on "Import File" button of Bank journal
- Select a CSV file with bank statements
- On the left menu, select "No Separator" as "Thousands Separator"

Issue:
"Comma" is displayed as selected instead the first time.
The second time "No Separator" stays as selected.
However, the value sent when testing or importing is not the correct one.

Cause:
"No Separator" option should have an empty string as value.
However, during the generation of the "select" element, the value for the "option" element is evaluated with:
opt.value or opt
As opt.value is the empty string (evaluated to False), opt is used instead, even if it is an object, which is not correct.
The main issue is that the empty string is not handled as a valid value.

Solution:
Handle the empty string as an acceptable value.

opw-4325310


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr