mirror of
https://github.com/NaN-tic/trytond-aeat_347.git
synced 2023-12-14 02:03:00 +01:00
Add include_347 field in tax template to update this field throw an xml (347.xml) on tax tempalte and after when update account char, update it on tax
This commit is contained in:
parent
a2273ea9d4
commit
170ed00c68
|
@ -18,6 +18,7 @@ def register():
|
|||
invoice.Reasign347RecordStart,
|
||||
invoice.Reasign347RecordEnd,
|
||||
invoice.InvoiceTax,
|
||||
tax.TaxTemplate,
|
||||
tax.Tax,
|
||||
module='aeat_347', type_='model')
|
||||
Pool.register(
|
||||
|
|
20
tax.py
20
tax.py
|
@ -9,7 +9,25 @@ from trytond.transaction import Transaction
|
|||
from sql.operators import In
|
||||
from .aeat import OPERATION_KEY
|
||||
|
||||
__all__ = ['Tax']
|
||||
__all__ = ['TaxTemplate', 'Tax']
|
||||
|
||||
|
||||
class TaxTemplate:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'account.tax.template'
|
||||
|
||||
include_347 = fields.Boolean('Include 347')
|
||||
|
||||
@staticmethod
|
||||
def default_include_347():
|
||||
return True
|
||||
|
||||
def _get_tax_value(self, tax=None):
|
||||
res = super(TaxTemplate, self)._get_tax_value(tax)
|
||||
|
||||
if not tax or tax.include_347 != self.include_347:
|
||||
res['include_347'] = self.include_347
|
||||
return res
|
||||
|
||||
|
||||
class Tax:
|
||||
|
|
|
@ -8,3 +8,4 @@ xml:
|
|||
invoice.xml
|
||||
party.xml
|
||||
tax.xml
|
||||
347.xml
|
||||
|
|
Loading…
Reference in a new issue