Use country code of invoice address
This commit is contained in:
parent
a6b94e4f25
commit
61c46a054d
|
@ -94,8 +94,6 @@ class BaseTrytonInvoiceMapper(Model):
|
|||
return self.serial_number(invoice)
|
||||
|
||||
def counterpart_country(self, invoice):
|
||||
if invoice.party.sii_vat_country:
|
||||
return invoice.party.sii_vat_country
|
||||
return (invoice.invoice_address.country.code
|
||||
if invoice.invoice_address.country else '')
|
||||
|
||||
|
|
|
@ -462,10 +462,6 @@ msgctxt "field:party.party,sii_vat_code:"
|
|||
msgid "SII VAT Code"
|
||||
msgstr "Número NIF SII"
|
||||
|
||||
msgctxt "field:party.party,sii_vat_country:"
|
||||
msgid "SII VAT Country"
|
||||
msgstr "País NIF SII"
|
||||
|
||||
msgctxt "help:aeat.sii.report,load_date:"
|
||||
msgid "Filter invoices to the date whitin the period."
|
||||
msgstr "Filtra les factures fins la data dins del període."
|
||||
|
|
|
@ -463,10 +463,6 @@ msgctxt "field:party.party,sii_vat_code:"
|
|||
msgid "SII VAT Code"
|
||||
msgstr "Número NIF SII"
|
||||
|
||||
msgctxt "field:party.party,sii_vat_country:"
|
||||
msgid "SII VAT Country"
|
||||
msgstr "País NIF SII"
|
||||
|
||||
msgctxt "help:aeat.sii.report,load_date:"
|
||||
msgid "Filter invoices to the date whitin the period."
|
||||
msgstr "Filtra las facturas hasta la fecha dentro del período."
|
||||
|
|
4
party.py
4
party.py
|
@ -13,8 +13,6 @@ class Party(metaclass=PoolMeta):
|
|||
'SII Identifier Type', sort=False)
|
||||
sii_vat_code = fields.Function(fields.Char('SII VAT Code', size=9),
|
||||
'get_sii_vat_data')
|
||||
sii_vat_country = fields.Function(fields.Char('SII VAT Country', size=2),
|
||||
'get_sii_vat_data')
|
||||
|
||||
def get_sii_vat_data(self, name=None):
|
||||
identifier = self.tax_identifier or (
|
||||
|
@ -26,8 +24,6 @@ class Party(metaclass=PoolMeta):
|
|||
self.sii_identifier_type == '02'):
|
||||
return identifier.code
|
||||
return identifier.code[2:]
|
||||
elif name == 'sii_vat_country':
|
||||
return identifier.code[:2]
|
||||
|
||||
|
||||
class PartyIdentifier(metaclass=PoolMeta):
|
||||
|
|
Loading…
Reference in New Issue