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:
Bernat Brunet Torruella 2018-03-08 01:35:29 +01:00
parent a2273ea9d4
commit 170ed00c68
4 changed files with 7466 additions and 1 deletions

7445
347.xml Normal file

File diff suppressed because it is too large Load diff

View file

@ -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
View file

@ -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:

View file

@ -8,3 +8,4 @@ xml:
invoice.xml
party.xml
tax.xml
347.xml