odoo/odoo#198924

Created by fw-bot
Merged at fa582dfa7745f65a008dac9853bbcde51f3014d2

Statuses:

label
odoo-dev:saas-17.4-17.0-opw-4325310-fix_thousands_separator_import_bank_statement-pta-407873-fw
head
46c3c07d1bce76fd470dbbd36554ff805521dbd3
merged
8 months ago by Bugfix, Anh Thao Pham (pta)
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

[FW][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

Forward-Port-Of: #192536