Skip to content

[FIX] account_statement_import_sheet_file: Apply fixes on top of OCA 19.0 migration - #957

Closed
cav-adhoc wants to merge 2 commits into
OCA:19.0from
adhoc-dev:19.0-fix-account_statement_import_sheet_file
Closed

[FIX] account_statement_import_sheet_file: Apply fixes on top of OCA 19.0 migration#957
cav-adhoc wants to merge 2 commits into
OCA:19.0from
adhoc-dev:19.0-fix-account_statement_import_sheet_file

Conversation

@cav-adhoc

@cav-adhoc cav-adhoc commented May 22, 2026

Copy link
Copy Markdown

Summary

This PR applies ADHOC-specific fixes and improvements on top of the OCA 19.0 migration (merged via #907), replacing the
previous ADHOC PR #894.

Changes included

Bug fixes from ADHOC PRs #870 / #894 not included in OCA #907:

  • openpyxl support for .xlsx files: OCA's migration only kept xlrd (old .xls format). This adds a fallback chain xlrd →
    openpyxl → CSV so modern Excel files continue to work. Affects parse_header, _parse_lines, and _parse_rows.
  • Integer values in column concatenation (core fix of PR [FIX] account_statement_import_sheet_file: Handle integer values in column concatenation #894): _get_values_from_column now handles integer cell values when
    concatenating multiple columns, preventing a crash when xlrd/openpyxl returns numeric types.
  • Case-insensitive column name matching: _get_column_indexes now tries an exact match first, then falls back to
    case-insensitive before raising ValueError.
  • str() cast in _parse_decimal: Handles non-string cell values that can arrive from xlrd/openpyxl, preventing re.sub from
    crashing.

Model fixes:

  • Remove duplicate amount_column field definition introduced in OCA [19.0][MIG] account_statement_import_sheet_file: Migration to 19 #907 (defined twice with conflicting help text).
  • Fix typo in amount_type help text: "use igned amount" → "use signed amount".
  • Add _clear_amount_columns onchange: automatically clears irrelevant amount columns when amount_type changes, preventing
    invalid configurations.

Tests:

  • No changes — kept OCA's original test structure from the 19.0 migration as-is.

Replaces

This PR replaces #894 (which was based on a pre-#907 migration). The previous PR should be closed.

🤖 Generated with Claude Code

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @alexey-pelykh,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added mod:account_statement_import_sheet_file Module account_statement_import_sheet_file series:19.0 labels May 22, 2026
@cav-adhoc
cav-adhoc force-pushed the 19.0-fix-account_statement_import_sheet_file branch from f8844c2 to 6c3e6e0 Compare May 22, 2026 18:56
…19.0 migration

- Add openpyxl support for .xlsx files (OCA only kept xlrd/.xls format)
- Fix integer values in column concatenation (_get_values_from_column)
- 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 in PR OCA#907)
- Fix typo in amount_type help text ("igned" -> "signed")
- Add _clear_amount_columns onchange to clear irrelevant fields on type change
- Remove data/map_data.xml from data list (keep as demo only); no impact
  on existing databases since the record and its XML ID remain in place
- Create sample_statement_map inline in tests with .create() instead of
  env.ref() so tests run independently of demo data
- Update tests to use BaseCommon and cover xlsx/openpyxl scenarios
- Add missing Tecnativa and BCIM copyrights to parser and tests
@cav-adhoc
cav-adhoc force-pushed the 19.0-fix-account_statement_import_sheet_file branch from 6c3e6e0 to 566dc90 Compare May 22, 2026 18:58
@cav-adhoc cav-adhoc changed the title [FIX] account_statement_import_sheet_file: ADHOC fixes on top of OCA 19.0 migration [FIX] account_statement_import_sheet_file: Apply fixes on top of OCA 19.0 migration May 22, 2026
@cav-adhoc
cav-adhoc force-pushed the 19.0-fix-account_statement_import_sheet_file branch 2 times, most recently from e02410c to 3387480 Compare May 22, 2026 19:25
@Andrii9090-tecnativa

Copy link
Copy Markdown

We are currently working on a refactoring of this module so that we can extend the this module, which by default will only work with CSV files. This gives us greater flexibility and the option to use modules to add the ability to import XLS and XLSX and other files.

@feg-adhoc
feg-adhoc force-pushed the 19.0-fix-account_statement_import_sheet_file branch from 3387480 to 1c651a7 Compare May 26, 2026 14:01
@pedrobaeza

Copy link
Copy Markdown
Member

Replaced by #969

@pedrobaeza pedrobaeza closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:account_statement_import_sheet_file Module account_statement_import_sheet_file series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants