Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0][FIX] l10n_es_facturae: The bank code should be obtained from the mandate in direct debits #1246

Conversation

eantones
Copy link
Contributor

@eantones eantones commented Jan 6, 2020

The bank code is being acquired from the field partner_bank_id of the invoice but this field can be null.

The bank code must be acquired from the same field partner_bank_id but from the mandate mandate_id just as the other bank data as IBAN and BIC.

Can you review it please?

cc @etobella @pedrobaeza

…date in direct debits

The bank code is being acquired from the field `partner_bank_id` of the invoice but this field can be null. The bank code must be acquired from the same field `partner_bank_id' but from the mandate `mandate_id` just as the other bank data as IBAN and BIC.
Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

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

No sé si debería serinvoice.partner_bank_id.bank_id.code or invoice.mandate_id.partner_bank_id.bank_id.code.
Aunque personalmente creo que debe ser exactamente lo mismo, ya que el mandato generalmente es para una única cuenta.
:LGTM: Por mi parte creo que es mejor dejarlo así.

@etobella
Copy link
Member

etobella commented Jan 6, 2020

Por cierto, @eantones en este repositorio de la OCA se puede escribir en español, ya que es una localización 😉

@eantones
Copy link
Contributor Author

eantones commented Jan 8, 2020

Muchas gracias @etobella

No creo que sea lo mismo ya que en una factura con método de pago "Adeudo directo" el campo invoice.partner_bank_id no tiene porqué estar informado.

Saludos :-)

@pedrobaeza pedrobaeza added this to the 11.0 milestone Jan 8, 2020
@pedrobaeza
Copy link
Member

Cuando se cambia el mandato, se cambia partner_bank_id en la factura, así que yo tampoco veo qué aporta este cambio y en qué caso está desincronizado.

@etobella
Copy link
Member

etobella commented Jan 8, 2020

Realmente no cambia nada, así que por mi parte lo podemos dejar así

@eantones
Copy link
Contributor Author

eantones commented Jan 8, 2020

Lo que aporta es que no devuelva un error al crear la factura electrónica cuando el campo invoice.partner_bank_id no esta informado que es el caso de los "Adeudos directos".

Adicionalmente, por coherencia, si todos los campos del banco se cogen del partner_bank_id del mandato, porque coger uno del partner_bank_id de la factura:

<IBAN t-minlength="5" t-length="34" t-esc="''.join(invoice.mandate_id.partner_bank_id.acc_number.split())"/>
<BankCode t-length="60" t-esc="invoice.partner_bank_id.bank_id.code"/>
<BranchCode t-length="60" t-if="False"/>
<BIC t-minlength="11" t-length="11" t-esc="invoice.mandate_id.partner_bank_id.bank_id.bic"/>

También, en la validación previa, únicamente valida el partner_bank_iddel mandato y no el de la factura:

if not self.mandate_id.partner_bank_id:
raise ValidationError(_('Partner bank in mandate is missing'))

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 12, 2021
@github-actions github-actions bot closed this Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants