Branch 4.2

This commit is contained in:
Sergio Morillo 2017-09-12 17:13:21 +02:00
parent 022fdbcb93
commit f3bc9deebe
14 changed files with 21 additions and 20 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

@ -19,10 +19,14 @@ class Party:
'get_sii_vat_data')
def get_sii_vat_data(self, name=None):
if self.vat_code:
identifier = self.tax_identifier or (
self.identifiers and self.identifiers[0])
if identifier:
if name == 'sii_vat_code':
return (self.vat_code[-9:]
if self.type == 'eu_vat' else self.vat_code)
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 (self.vat_code[:2]
if self.type == 'eu_vat' else None)
return identifier[:2]

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

@ -1,5 +1,5 @@
[tryton]
version=4.0.0
version=4.2.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"/>