Skip to content

[16.0][IMP] l10n_es_account_statement_import_n43: detectar partner en transferencias entrantes Sabadell - #4817

Open
IJOL wants to merge 3 commits into
OCA:16.0from
BITVAX:16.0-fix-n43-sabadell-incoming-partner
Open

[16.0][IMP] l10n_es_account_statement_import_n43: detectar partner en transferencias entrantes Sabadell#4817
IJOL wants to merge 3 commits into
OCA:16.0from
BITVAX:16.0-fix-n43-sabadell-incoming-partner

Conversation

@IJOL

@IJOL IJOL commented Feb 12, 2026

Copy link
Copy Markdown

Resumen

Las transferencias entrantes N43 de Sabadell codifican el nombre del partner en el concepto 01 usando prefijos específicos que la detección existente no reconocía.

Se añade detección para tres prefijos:

  • NOMBRE DEL ORDENANTE (transferencias)
  • ORDENANTE DE LA TRANSFERENCIA (transferencias SEPA)
  • TRANSFERENC. DE (formato corto)

El nombre se extrae tras el prefijo, se eliminan sufijos legales (SL, SA, SLU, etc.) y se busca con ilike. Como último recurso, se busca por palabras individuales con regex de word boundary (\m...\M) para nombres truncados en el límite de 35 caracteres del campo concepto N43.

Test plan

  • Tests unitarios para cada prefijo
  • Test de word boundary regex (match positivo y negativo contra substrings)
  • Test de limpieza de sufijos legales
  • Validado con datos N43 reales de Sabadell

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @pedrobaeza,
some modules you are maintaining are being modified, check this out!

…ferencias entrantes Sabadell

Las transferencias entrantes N43 de Sabadell codifican el nombre del
partner en el concepto 01 usando prefijos específicos. La detección
existente no reconocía estos formatos, dejando muchas líneas entrantes
sin partner asignado.

Se añade detección para tres prefijos de transferencias entrantes:
- NOMBRE DEL ORDENANTE (transferencias)
- ORDENANTE DE LA TRANSFERENCIA (transferencias SEPA)
- TRANSFERENC. DE (formato corto)

El nombre del partner se extrae tras el prefijo, se eliminan sufijos
legales (SL, SA, SLU, etc.) para manejar diferencias de notación, y
se busca con ilike. Como último recurso, se busca por palabras
individuales con regex de word boundary para nombres truncados en el
límite de 35 caracteres del campo concepto N43.
@IJOL
IJOL force-pushed the 16.0-fix-n43-sabadell-incoming-partner branch from 583841a to 52bdaa0 Compare February 12, 2026 12:39
@IJOL

IJOL commented Feb 12, 2026

Copy link
Copy Markdown
Author

Los fallos de CI en "test with Odoo" y "test with OCB" no están relacionados con este PR.

Resumen: 0 failed, 14 error(s) of 401 tests — los 14 errores son de l10n_es_ticketbai_pos.

Causa raíz: TestL10nEsTicketBAIPoSOrder.test_create_invoice_from_pos_order y test_create_invoice_from_ui fallan con:

UserError: The company bank account linked to this invoice is not trusted,
please double-check and trust it before confirming, or remove it

El segundo fallo corrompe el savepoint de PostgreSQL, provocando que los 12 tests restantes de ticketbai_pos cascadeen con InFailedSqlTransaction.

Los 10 tests de N43 (3 originales + 7 nuevos de Sabadell) pasan sin errores en ambas ejecuciones.

@pedrobaeza pedrobaeza changed the title [IMP] l10n_es_account_statement_import_n43: detectar partner en transferencias entrantes Sabadell [16.0][IMP] l10n_es_account_statement_import_n43: detectar partner en transferencias entrantes Sabadell Feb 20, 2026
@pedrobaeza pedrobaeza added this to the 16.0 milestone Feb 20, 2026
IJOL added 2 commits February 26, 2026 14:06
…t_ref

The N43 record 23 stores concept text as two halves split at the
fixed-width boundary (position 39). The previous code added each half
as a separate element to a list and joined them with spaces, which
introduced a spurious space when the split fell mid-word
(e.g. "TPC CO CINAS" instead of "TPC COCINAS").

Now both halves of the same concept record are concatenated directly
before appending to the list, matching the existing partner_name
construction logic.
… prefixes

Add three new Sabadell partner detection prefixes:
- BENEFICIARIO DE LA TRANSFERENCIA (outgoing transfers, long form)
- BENEFICIARIO (outgoing transfers, short form)
- CORE (SEPA direct debits, name glued without space)

Prefix order matters: longer prefixes first to avoid partial matches
(e.g. BENEFICIARIO DE LA TRANSFERENCIA before BENEFICIARIO).
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.

3 participants