diff --git a/account.py b/account.py index 6a56971..1e047df 100644 --- a/account.py +++ b/account.py @@ -4,6 +4,7 @@ from trytond.model import fields from trytond.pool import PoolMeta from trytond.pyson import Eval from trytond.transaction import Transaction +from trytond.tools import cached_property from .aeat import (BOOK_KEY, OPERATION_KEY, SEND_SPECIAL_REGIME_KEY, RECEIVE_SPECIAL_REGIME_KEY, IVA_SUBJECTED, EXEMPTION_CAUSE, IVA_NOT_SUBJECTED) @@ -114,6 +115,17 @@ class Tax(metaclass=PoolMeta): sii_exemption_cause = fields.Selection(EXEMPTION_CAUSE, 'Exemption Cause') tax_used = fields.Boolean('Used in Tax') invoice_used = fields.Boolean('Used in invoice Total') + recargo_equivalencia = fields.Boolean('Recargo Equivalencia', + help='Indicates if the tax is Recargo de Equivalencia') + recargo_equivalencia_related_tax = fields.Many2One( + 'account.tax', 'Recargo Equivalencia Related Tax', + domain=[ + ('recargo_equivalencia', '=', True), + ('company', '=', Eval('company', -1)), + ], depends=['recargo_equivalencia', 'company'], + help='The possible Recargo Equivalencia related to this tax') + deducible = fields.Boolean('Deducible', + help='Indicates if the tax is deductible') @classmethod def __register__(cls, module_name): @@ -134,3 +146,7 @@ class Tax(metaclass=PoolMeta): if exist_sii_intracomunity_key: table.drop_column('sii_intracomunity_key') + + @staticmethod + def default_deducible(): + return True diff --git a/sii_core.xml b/sii_core.xml index 05eadb3..71d1337 100644 --- a/sii_core.xml +++ b/sii_core.xml @@ -2,7 +2,15 @@ - + + + + account.tax + + tax_form_core + + + R 01 @@ -121,15 +129,16 @@ this repository contains the full copyright notices and license terms. --> R 09 - E6 - + S1 + + R 09 S1 - + diff --git a/view/tax_form_core.xml b/view/tax_form_core.xml new file mode 100644 index 0000000..2a49a85 --- /dev/null +++ b/view/tax_form_core.xml @@ -0,0 +1,14 @@ + + + + + +