mirror of
https://gitlab.com/datalifeit/trytond-aeat_340
synced 2023-12-14 06:03:02 +01:00
Meld aeat_340_es module with aeat_340 module and add data for account_es_pyme
This commit is contained in:
parent
d8d914bd55
commit
9d7c782e02
13
invoice.py
13
invoice.py
|
@ -3,6 +3,7 @@ from trytond.wizard import Wizard, StateView, StateTransition, Button
|
|||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
from trytond.transaction import Transaction
|
||||
from sql import Literal
|
||||
from sql.operators import In
|
||||
from .aeat import BOOK_KEY, OPERATION_KEY, PARTY_IDENTIFIER_TYPE
|
||||
|
||||
|
@ -61,6 +62,18 @@ class TypeTemplateTax(ModelSQL):
|
|||
tax = fields.Many2One('account.tax.template', 'Template Tax',
|
||||
ondelete='CASCADE', select=True, required=True)
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
ModelData = Pool().get('ir.model.data')
|
||||
cursor = Transaction().cursor
|
||||
sql_table = ModelData.__table__()
|
||||
# Meld aeat_340_es into aeat_340
|
||||
cursor.execute(*sql_table.update(
|
||||
columns=[sql_table.module],
|
||||
values=[module_name],
|
||||
where=sql_table.module == Literal('aeat_340_es')))
|
||||
super(TypeTemplateTax, cls).__register__(module_name)
|
||||
|
||||
|
||||
class Record(ModelSQL, ModelView):
|
||||
"""
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
version=3.4.0
|
||||
depends:
|
||||
account_invoice
|
||||
extras_depend:
|
||||
account_es
|
||||
account_es_pyme
|
||||
xml:
|
||||
aeat.xml
|
||||
invoice.xml
|
||||
|
|
Loading…
Reference in a new issue