odoo/odoo#198928

Created by fw-bot
Merged at 15cf08f5f3fd40445bbb43e1118d13a8c2b72ab2

Statuses:

label
odoo-dev:18.0-17.0-opw-4325310-fix_thousands_separator_import_bank_statement-pta-418124-fw
head
788259e51545c8bc9032b0c548434e97c60e8dc6
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