[ADD] l10n_es_edi_tbai_reagyp_recibidas: fix REAGYP vendor bill regime key
Native l10n_es_edi_tbai hardcodes ClaveRegimenIvaOpTrascendencia '19' for REAGYP vendor bills, but '19' only exists in the issued-invoices book. The Batuz LROE schema for received invoices rejects it (cvc-enumeration-valid), where the valid REAGYP-compensation key is '02'. Override _l10n_es_tbai_get_vendor_bill_values_batuz to remap 19 -> 02. Upstream: https://github.com/odoo/odoo/pull/266214 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
eb515c28e1
commit
66a5e31060
5 changed files with 85 additions and 0 deletions
1
l10n_es_edi_tbai_reagyp_recibidas/models/__init__.py
Normal file
1
l10n_es_edi_tbai_reagyp_recibidas/models/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from . import account_move # noqa: F401
|
||||
16
l10n_es_edi_tbai_reagyp_recibidas/models/account_move.py
Normal file
16
l10n_es_edi_tbai_reagyp_recibidas/models/account_move.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Copyright 2026 - Today Criptomart
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = "account.move"
|
||||
|
||||
def _l10n_es_tbai_get_vendor_bill_values_batuz(self):
|
||||
values = super()._l10n_es_tbai_get_vendor_bill_values_batuz()
|
||||
# Clave 19 (REAGYP) sólo existe en el libro de facturas emitidas. En
|
||||
# facturas recibidas, la compensación REAGYP se declara con la clave 02,
|
||||
# única válida en el esquema LROE de recibidas.
|
||||
if values.get("regime_key") == ["19"]:
|
||||
values["regime_key"] = ["02"]
|
||||
return values
|
||||
Loading…
Add table
Add a link
Reference in a new issue