odoo/odoo#198934

Created by fw-bot
Merged at c5fec6e979a4c2249e07092ffec83ce742ab9ebe

Statuses:

label
odoo-dev:saas-18.1-17.0-opw-4325310-fix_thousands_separator_import_bank_statement-pta-418128-fw
head
338f0d58b797e287eededaf0e79843213cfd2f4b
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