Upgrade from 4.2 series

From changeset-34eb534d3331
This commit is contained in:
Raimon Esteve 2017-11-01 08:18:21 +01:00
parent ce009f3a05
commit d06f9affa6
16 changed files with 22 additions and 23 deletions

View file

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

View file

@ -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')

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
[tryton]
version=4.0.0
version=4.3.0
depends:
account_invoice
extras_depend:

View file

@ -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"/>

View file

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

View file

@ -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"/>

View file

@ -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"/>

View file

@ -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"/>

View file

@ -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"/>

View file

@ -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"/>

View file

@ -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"/>