mirror of
https://gitlab.com/datalifeit/trytond-aeat_sii
synced 2023-12-13 20:30:37 +01:00
Upgrade from 4.2 series
From changeset-34eb534d3331
This commit is contained in:
parent
ce009f3a05
commit
d06f9affa6
16 changed files with 22 additions and 23 deletions
2
aeat.py
2
aeat.py
|
@ -778,7 +778,7 @@ class SIIReportLine(ModelSQL, ModelView):
|
|||
return self.invoice.sii_operation_key
|
||||
|
||||
def get_vat_code(self, name):
|
||||
return self.invoice.party.vat_code if self.invoice else None
|
||||
return self.invoice.party.sii_vat_code if self.invoice else None
|
||||
|
||||
def get_identifier_type(self, name):
|
||||
return self.invoice.party.sii_identifier_type if self.invoice else None
|
||||
|
|
|
@ -44,6 +44,7 @@ class BaseTrytonInvoiceMapper(Model):
|
|||
|
||||
counterpart_id_type = attrgetter('party.sii_identifier_type')
|
||||
counterpart_id = counterpart_nif
|
||||
|
||||
untaxed_amount = attrgetter('untaxed_amount')
|
||||
total_amount = attrgetter('total_amount')
|
||||
tax_rate = attrgetter('tax.rate')
|
||||
|
|
13
party.py
13
party.py
|
@ -19,13 +19,14 @@ class Party:
|
|||
'get_sii_vat_data')
|
||||
|
||||
def get_sii_vat_data(self, name=None):
|
||||
# TODO upgrade 4.2 has tax_identifier and is m2o
|
||||
identifier = self.vat_code
|
||||
identifier = self.tax_identifier or (
|
||||
self.identifiers and self.identifiers[0])
|
||||
if identifier:
|
||||
if name == 'sii_vat_code':
|
||||
return identifier[-9:]
|
||||
if (identifier.type == 'eu_vat' and
|
||||
not identifier.code.startswith('ES') and
|
||||
self.sii_identifier_type == '02'):
|
||||
return identifier.code
|
||||
return identifier.code[2:]
|
||||
elif name == 'sii_vat_country':
|
||||
return identifier[:2]
|
||||
else:
|
||||
if name == 'sii_vat_code':
|
||||
return self.identifiers and self.identifiers[0].code or None
|
||||
|
|
|
@ -8,6 +8,7 @@ Imports::
|
|||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import config, Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
|
@ -23,11 +24,7 @@ Create database::
|
|||
|
||||
Install account_sii::
|
||||
|
||||
>>> Module = Model.get('ir.module')
|
||||
>>> account_sii_module, = Module.find(
|
||||
... [('name', '=', 'aeat_sii')])
|
||||
>>> account_sii_module.click('install')
|
||||
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
|
||||
>>> config = activate_modules('aeat_sii')
|
||||
|
||||
Create company::
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import unittest
|
|||
import doctest
|
||||
import trytond.tests.test_tryton
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
from trytond.tests.test_tryton import doctest_setup, doctest_teardown
|
||||
from trytond.tests.test_tryton import doctest_teardown
|
||||
from trytond.tests.test_tryton import doctest_checker
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ def suite():
|
|||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
AeatSIITestCase))
|
||||
suite.addTests(doctest.DocFileSuite('scenario_aeat_sii.rst',
|
||||
setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
|
||||
tearDown=doctest_teardown, encoding='utf-8',
|
||||
checker=doctest_checker,
|
||||
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
|
||||
return suite
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=4.0.0
|
||||
version=4.3.0
|
||||
depends:
|
||||
account_invoice
|
||||
extras_depend:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license types. -->
|
||||
<form string="Load PKCS12" col="2">
|
||||
<form col="2">
|
||||
<label name="pfx"/>
|
||||
<field name="pfx"/>
|
||||
<label name="password"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<form string="AEAT SII Data Reassigment Done" col="2">
|
||||
<form col="2">
|
||||
<image name="tryton-dialog-information" xexpand="0" xfill="0"/>
|
||||
<label string="The AEAT SII records have been reasigned."
|
||||
id="data"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<form string="AEAT SII Issued Report" col="6">
|
||||
<form col="6">
|
||||
<label name="company"/>
|
||||
<field name="company"/>
|
||||
<label name="company_vat"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tree string="SII Report Line Tax">
|
||||
<tree>
|
||||
<field name="line"/>
|
||||
<field name="base"/>
|
||||
<field name="rate"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<form string="AEAT SII Issued">
|
||||
<form>
|
||||
<label name="report"/>
|
||||
<field name="report"/>
|
||||
<label name="invoice"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tree string="AEAT SII Issued Lines">
|
||||
<tree>
|
||||
<field name="report"/>
|
||||
<field name="invoice"/>
|
||||
<field name="invoice_operation_key"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tree string="AEAT SII Issued Lines" editable="bottom">
|
||||
<tree editable="bottom">
|
||||
<field name="report"/>
|
||||
<field name="invoice"/>
|
||||
<field name="invoice_operation_key"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tree string="AEAT SII Issued Report">
|
||||
<tree>
|
||||
<field name="company"/>
|
||||
<field name="company_vat"/>
|
||||
<field name="book"/>
|
||||
|
|
Loading…
Reference in a new issue