[FIX] account_statement_import_sheet_file_bg: adapt to sheet parser refactor - #427
Open
feg-adhoc wants to merge 1 commit into
Open
[FIX] account_statement_import_sheet_file_bg: adapt to sheet parser refactor#427feg-adhoc wants to merge 1 commit into
feg-adhoc wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Este PR adapta account_statement_import_sheet_file_bg al refactor del parser de sheets en OCA, donde la lógica de parseo pasa a estar despachada por mimetype y el soporte XLSX se mueve a account_statement_import_sheet_file_xlsx. El objetivo es que el flujo en background vuelva a funcionar (incluyendo CSV que se convierten/enfilan como XLSX).
Changes:
- Se agrega la dependencia a
account_statement_import_sheet_file_xlsxpara asegurar que existan handlers XLSX en el parseo. - Se reescribe
split_base64_excelpara leer XLSX/CSV sin depender de la API de parser anterior, y generar siempre partes en XLSX. - Se elimina el override muerto del parser (
parse_header) y su import.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| account_statement_import_sheet_file_bg/models/account_statement_import.py | Reimplementa lectura/splitting XLSX/CSV y el filtrado de filas por fecha para jobs en background. |
| account_statement_import_sheet_file_bg/models/init.py | Elimina el import del parser override removido. |
| account_statement_import_sheet_file_bg/models/account_statement_import_sheet_parser.py | Se borra el override de parse_header que ya no aplica tras el refactor upstream. |
| account_statement_import_sheet_file_bg/manifest.py | Agrega dependencia a account_statement_import_sheet_file_xlsx para asegurar parseo XLSX. |
Comment on lines
+255
to
+259
| header = [] | ||
| for value in all_rows[header_line]: | ||
| raw_value = value.value if hasattr(value, "value") else value | ||
| header.append(str(raw_value).strip() if raw_value is not None else "") | ||
| return header |
Comment on lines
191
to
192
| if date_column_index is not None: | ||
| data_rows = [r for r in data_rows if len(r) > date_column_index and r[date_column_index]] |
Comment on lines
+214
to
+216
| Supports XLSX (openpyxl) and CSV. Other formats are left to the | ||
| standard synchronous import. | ||
| """ |
feg-adhoc
force-pushed
the
19.0-h-123605-feg
branch
from
July 22, 2026 19:29
2528313 to
eec9d5b
Compare
…efactor The OCA refactor split XLSX support out of account_statement_import_sheet_file into account_statement_import_sheet_file_xlsx and replaced the monolithic parser (parse_header/_parse_lines) with a mimetype-based dispatch. This module always emits XLSX chunks, so: - depend on account_statement_import_sheet_file_xlsx (otherwise the chunks have no parser and the import fails with 'format not supported', also for CSV inputs that are converted to XLSX); - rewrite split_base64_excel to read/split the file without the removed parser API (parse_header/_parse_rows) and drop the xlrd path; - remove the now-dead sheet parser override.
feg-adhoc
force-pushed
the
19.0-h-123605-feg
branch
from
July 22, 2026 19:56
eec9d5b to
03cf31f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Context
The OCA
account_statement_import_sheet_filemodule was refactored: XLSX support was moved to a new moduleaccount_statement_import_sheet_file_xlsx, and the monolithic parser (parse_header/_parse_lines) was replaced by a mimetype-based dispatch (_get_sheet_type→_parse_lines_<type>).This module (
_bg) was written against the old API and always emits XLSX chunks (even for CSV inputs), so after the refactor the generated chunks had no parser and the import failed with "format not supported" — including CSV imports, which are converted to XLSX before being enqueued.Changes
account_statement_import_sheet_file_xlsx(the chunks are always XLSX; without it there is no_parse_lines_xlsx).split_base64_excelto read and split the file (XLSX via openpyxl, CSV fallback) without the removed parser API, using_get_column_indexesonly for date-column detection.xlrdpath.parse_header, which no longer exists in the base).Test
pre-commitgreen; module imports/splits reviewed. Pending runbot + functional check on a real base.