Skip to content

[FIX] account_statement_import_sheet_file: Handle integer values in column concatenation - #894

Closed
cav-adhoc wants to merge 51 commits into
OCA:19.0from
adhoc-dev:19.0-h-107850-cav
Closed

[FIX] account_statement_import_sheet_file: Handle integer values in column concatenation#894
cav-adhoc wants to merge 51 commits into
OCA:19.0from
adhoc-dev:19.0-h-107850-cav

Conversation

@cav-adhoc

Copy link
Copy Markdown

No description provided.

primes2h and others added 30 commits December 18, 2025 12:03
[FIX] Mostly currency-related fixes

[IMP] sample_statement_en test: add dates on description

Co-authored-by: Marco Colombo <marco.colombo@gmail.com>

[UPD] Update account_statement_import_txt_xlsx.pot
Translated using Weblate (Italian)

Currently translated at 64.3% (56 of 87 strings)

Translation: bank-statement-import-14.0/bank-statement-import-14.0-account_statement_import_txt_xlsx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_txt_xlsx/it/

Translated using Weblate (Italian)

Currently translated at 73.5% (64 of 87 strings)

Translation: bank-statement-import-14.0/bank-statement-import-14.0-account_statement_import_txt_xlsx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_txt_xlsx/it/

Translated using Weblate (Italian)

Currently translated at 98.8% (86 of 87 strings)

Translation: bank-statement-import-14.0/bank-statement-import-14.0-account_statement_import_txt_xlsx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_txt_xlsx/it/
Currently translated at 100.0% (87 of 87 strings)

Translation: bank-statement-import-14.0/bank-statement-import-14.0-account_statement_import_txt_xlsx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_txt_xlsx/es_AR/

account_statement_import_txt_xlsx 14.0.1.0.1
[UPD] Update account_statement_import_txt_xlsx.pot

[UPD] README.rst
Currently translated at 100.0% (87 of 87 strings)

Translation: bank-statement-import-15.0/bank-statement-import-15.0-account_statement_import_txt_xlsx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_txt_xlsx/it/
…r IN and OUT

[IMP] account_statement_import_txt_xlsx: wizard: amount2_reverse boolean field, with tests
… to column numbers, and concatenation

A new field 'File does not contain header line' is added in the Statement Sheet Mappings. If you set to True,
then you can map the columns by indicating in each field of the 'Columns' section the column number in the file.

We also allow to concatenate multiple columns in the file to a single column to a single field of the statement line.
You have to indicate the names of the columns separated by comma.
…ot provided in the import file

[UPD] Update account_statement_import_txt_xlsx.pot

account_statement_import_txt_xlsx 15.0.2.0.0

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: bank-statement-import-15.0/bank-statement-import-15.0-account_statement_import_txt_xlsx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_txt_xlsx/
…ping

account_statement_import_txt_xlsx 15.0.2.0.1
If there is a problem parsing the file we are not showing the error
to the user, instead a generic message telling something is wrong
with the type of file is shown, and we only showing the error if
we are running unit tests.

In this case we think is good to show the error to the user, this
way they can check what is wrong and fix it in the sheet mapping.

* We are only showing the title of the error as a HINT, we think that is
  a good start to undestand what needs to change in the sheet mapping.
* The complete traceback error is shown in the log if we needed for more
  detail review from the technical teams.
Currently translated at 74.4% (73 of 98 strings)

Translation: bank-statement-import-15.0/bank-statement-import-15.0-account_statement_import_txt_xlsx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_txt_xlsx/it/
Currently translated at 98.9% (97 of 98 strings)

Translation: bank-statement-import-15.0/bank-statement-import-15.0-account_statement_import_txt_xlsx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_txt_xlsx/es/
- Depending on the installed set of modules, the company currency may
  be USD or EUR. If the second case, these tests will fail, so we make
  sure that the company currency is USD for our tests, doing the change
  by SQL, as there's a Python constraint that prevents it.

Not needed in v17 due to: odoo/odoo#107113.

account_statement_import_txt_xlsx 15.0.2.0.2

[UPD] Update account_statement_import_txt_xlsx.pot

account_statement_import_txt_xlsx 15.0.2.0.3

[UPD] README.rst

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: bank-statement-import-15.0/bank-statement-import-15.0-account_statement_import_txt_xlsx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_txt_xlsx/
[IMP] add csv meta data management
[FIX] exclude footer meta data
[IMP] import separated credit/debit column file
[FIX] make comptatible with new version of multi_step_wizard module & add migration file
[FIX] all not provided value are handled in_parse_decimal method
[REF] Remove unnecessary \n

Renamed to account_statement_import_sheet_file

Co-authored-by: zaoral
Currently translated at 100.0% (95 of 95 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_sheet_file/es/
…ign_column.

In some cases such as in credit card statements the amounts are expressed in the inverse sign.
By setting this flag during the upload the amounts will be inverted in sign.
Currently translated at 95.9% (95 of 99 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_sheet_file/tr/
Currently translated at 100.0% (99 of 99 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_sheet_file/es/
Currently translated at 58.5% (58 of 99 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_sheet_file/it/
Currently translated at 98.9% (98 of 99 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_sheet_file/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_sheet_file/
Currently translated at 100.0% (100 of 100 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_sheet_file/it/
mileo and others added 21 commits December 18, 2025 12:03
Currently translated at 100.0% (100 of 100 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_sheet_file/es/
Currently translated at 100.0% (99 of 99 strings)

Translation: bank-statement-import-17.0/bank-statement-import-17.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-17-0/bank-statement-import-17-0-account_statement_import_sheet_file/it/
Currently translated at 100.0% (99 of 99 strings)

Translation: bank-statement-import-17.0/bank-statement-import-17.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-17-0/bank-statement-import-17-0-account_statement_import_sheet_file/zh_CN/
Currently translated at 100.0% (104 of 104 strings)

Translation: bank-statement-import-17.0/bank-statement-import-17.0-account_statement_import_sheet_file
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-17-0/bank-statement-import-17-0-account_statement_import_sheet_file/it/
There can be files where the date is only expressed with day and month,
but no year. You put in that case a timestamp expression like '%d/%m'.
For that, strptime parses the content and return the day and month in
the year 1900.

This code checks that condition and replace the year by the current one,
as clearly 1900 is not a year to post transactions. There's also logic
for putting previous year if the current month is lower than the
imported one (i.e., current month is January and you are importing
December).
…parser header

When importing an Excel file with a header and the field header_lines_skip_count is set to its default value (0), the header is retrieved using the -1 index (the last row).
complementary to commit OCA@13285ab
…tune the UI

Before this commit, the parse_header function was unused. It is now
utilized to reduce redundant code and improve maintainability.
Additionally, UI adjustments have been made for better usability and clarity.
- Reuse duplicated code:
  * Journal creation
  * Wizard creation
  * etc
- Remove obsolete code.
- Increase readability of the tests.
- Use setUpClass instead of setUp.

@alexey-pelykh alexey-pelykh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. The integer handling in column concatenation is a real issue with XLSX files -- cell values can come back as int rather than str. Fix looks correct, CI green. LGTM

cav-adhoc added a commit to adhoc-dev/bank-statement-import that referenced this pull request May 22, 2026
…19.0 migration

- Add openpyxl support for .xlsx files (OCA only kept xlrd/.xls format)
  via fallback chain xlrd -> openpyxl -> CSV in _parse_lines, parse_header
  and _parse_rows
- Fix integer values in column concatenation in _get_values_from_column
  (core fix of PR OCA#894: crash when xlrd/openpyxl returns numeric cell types)
- Add case-insensitive column name matching in _get_column_indexes
- Use str() cast in _parse_decimal to handle non-string cell values
- Remove duplicate amount_column field definition (OCA bug from PR OCA#907)
- Fix typo in amount_type help text ("use igned amount" -> "use signed amount")
- Add _clear_amount_columns onchange to clear irrelevant fields on type change
@cav-adhoc cav-adhoc closed this May 22, 2026
@cav-adhoc cav-adhoc reopened this May 22, 2026
@cav-adhoc

Copy link
Copy Markdown
Author

included in #957

@cav-adhoc cav-adhoc closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.