Skip to content

[14.0] account_banking_pain_base: Wrong length in AdrLine #1209

@jonerikceberio

Description

@jonerikceberio

When generating the PAIN file, the second node AdrLine is generated as the join of zip and city. Both fields are limited to 70 char in the process, but then are joined, which can result in a >70 char AdrLine, and therefore in an error:
odoo.addons.account_banking_pain_base.models.account_payment_order: Element '{urn:iso:std:iso:20022:tech:xsd:pain.008.001.02}AdrLine': [facet 'maxLength'] The value has a length of '76'; this exceeds the allowed maximum length of '70'

To Reproduce:

  • Create a partner with zip and city, and length of the city field with a length of 70.
  • Create an invoice to that partner
  • Add the invoce to a payment order
  • Generate the file, which will turn into an error

Possible solution:

  • Modify line 550, slicing the result of the join to 70
  • Modify line 546, substracting to 70 the length of the first element in val (if it exists) + 1 (for the space of the join)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugno staleUse this label to prevent the automated stale action from closing this PR/Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions