parent
52a573fcc3
commit
f8c3616eab
|
@ -56,7 +56,7 @@ class Invoice(metaclass=PoolMeta):
|
||||||
raise UserError(gettext('missing_facturae_party_info',
|
raise UserError(gettext('missing_facturae_party_info',
|
||||||
party=party.rec_name,
|
party=party.rec_name,
|
||||||
field=fields))
|
field=fields))
|
||||||
if not party.addresses[0].id_electronet:
|
if not party.id_electronet:
|
||||||
raise UserError(gettext('missing_facturae_party_info',
|
raise UserError(gettext('missing_facturae_party_info',
|
||||||
party=party.rec_name,
|
party=party.rec_name,
|
||||||
field='ID Electronet'))
|
field='ID Electronet'))
|
||||||
|
|
2
party.py
2
party.py
|
@ -7,10 +7,8 @@ from trytond.pool import PoolMeta
|
||||||
class Party(metaclass=PoolMeta):
|
class Party(metaclass=PoolMeta):
|
||||||
__name__ = 'party.party'
|
__name__ = 'party.party'
|
||||||
id_electronet = fields.Char('Id Electronet')
|
id_electronet = fields.Char('Id Electronet')
|
||||||
#TODO: migrate id_electronet from party to address?
|
|
||||||
|
|
||||||
|
|
||||||
class Address(metaclass=PoolMeta):
|
class Address(metaclass=PoolMeta):
|
||||||
__name__ = 'party.address'
|
__name__ = 'party.address'
|
||||||
electronet_sale_point = fields.Char('Electronet Sale Point')
|
electronet_sale_point = fields.Char('Electronet Sale Point')
|
||||||
id_electronet = fields.Char('Id Electronet')
|
|
||||||
|
|
|
@ -3,6 +3,13 @@
|
||||||
copyright notices and license terms. -->
|
copyright notices and license terms. -->
|
||||||
<tryton>
|
<tryton>
|
||||||
<data>
|
<data>
|
||||||
|
<!-- party.party -->
|
||||||
|
<record model="ir.ui.view" id="party_view_form">
|
||||||
|
<field name="model">party.party</field>
|
||||||
|
<field name="inherit" ref="party.party_view_form"/>
|
||||||
|
<field name="name">party_form</field>
|
||||||
|
</record>
|
||||||
|
<!-- party.address -->
|
||||||
<record model="ir.ui.view" id="address_view_form">
|
<record model="ir.ui.view" id="address_view_form">
|
||||||
<field name="model">party.address</field>
|
<field name="model">party.address</field>
|
||||||
<field name="inherit" ref="party.address_view_form"/>
|
<field name="inherit" ref="party.address_view_form"/>
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
<TaxIdentificationNumber>{{ invoice.company.party.tax_identifier.code[:30] }}</TaxIdentificationNumber>
|
<TaxIdentificationNumber>{{ invoice.company.party.tax_identifier.code[:30] }}</TaxIdentificationNumber>
|
||||||
</TaxIdentification>
|
</TaxIdentification>
|
||||||
{# Optional. It could be the ID or the code #}
|
{# Optional. It could be the ID or the code #}
|
||||||
<PartyIdentification>{{ invoice.company.id_electronet }}</PartyIdentification>
|
<PartyIdentification>{{ invoice.company.party.id_electronet }}</PartyIdentification>
|
||||||
{% if invoice.company.oficina_contable or invoice.company.organo_gestor or invoice.company.unidad_tramitadora or invoice.company.organo_proponente %}
|
{% if invoice.company.oficina_contable or invoice.company.organo_gestor or invoice.company.unidad_tramitadora or invoice.company.organo_proponente %}
|
||||||
<AdministrativeCentres>
|
<AdministrativeCentres>
|
||||||
{% if invoice.company.oficina_contable %}{{ administrative_center(invoice.company.oficina_contable, '01', invoice.company.facturae_person_type, invoice.company.party.address_get('invoice')) }}{% endif %}
|
{% if invoice.company.oficina_contable %}{{ administrative_center(invoice.company.oficina_contable, '01', invoice.company.facturae_person_type, invoice.company.party.address_get('invoice')) }}{% endif %}
|
||||||
|
|
|
@ -60,7 +60,7 @@ class AccountInvoiceFacturaeElectronetTestCase(CompanyTestMixin, ModuleTestCase)
|
||||||
company.party.identifiers = [tax_identifier]
|
company.party.identifiers = [tax_identifier]
|
||||||
company.facturae_person_type = 'J'
|
company.facturae_person_type = 'J'
|
||||||
company.facturae_residence_type = 'R'
|
company.facturae_residence_type = 'R'
|
||||||
company.id_electronet = '100'
|
company.party.id_electronet = '100'
|
||||||
company.party.save()
|
company.party.save()
|
||||||
company.save()
|
company.save()
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class AccountInvoiceFacturaeElectronetTestCase(CompanyTestMixin, ModuleTestCase)
|
||||||
address.facturae_person_type = 'J'
|
address.facturae_person_type = 'J'
|
||||||
address.facturae_residence_type = 'R'
|
address.facturae_residence_type = 'R'
|
||||||
address.organo_proponente = 'Test Organo Proponente'
|
address.organo_proponente = 'Test Organo Proponente'
|
||||||
address.id_electronet = '100'
|
company.party.id_electronet = '100'
|
||||||
address.organo_gestor = 'TEST'
|
address.organo_gestor = 'TEST'
|
||||||
address.unidad_tramitadora = 'TEST'
|
address.unidad_tramitadora = 'TEST'
|
||||||
address.organo_proponente = 'TEST'
|
address.organo_proponente = 'TEST'
|
||||||
|
@ -122,6 +122,7 @@ class AccountInvoiceFacturaeElectronetTestCase(CompanyTestMixin, ModuleTestCase)
|
||||||
tax_identifier = PartyIdentifier()
|
tax_identifier = PartyIdentifier()
|
||||||
tax_identifier.type = 'eu_vat'
|
tax_identifier.type = 'eu_vat'
|
||||||
tax_identifier.code = 'BE0897290877'
|
tax_identifier.code = 'BE0897290877'
|
||||||
|
party.id_electronet = '101'
|
||||||
party.identifiers = [tax_identifier]
|
party.identifiers = [tax_identifier]
|
||||||
party.save()
|
party.save()
|
||||||
|
|
||||||
|
@ -135,7 +136,6 @@ class AccountInvoiceFacturaeElectronetTestCase(CompanyTestMixin, ModuleTestCase)
|
||||||
'electronet_sale_point': 'TEST',
|
'electronet_sale_point': 'TEST',
|
||||||
'facturae_person_type': 'J',
|
'facturae_person_type': 'J',
|
||||||
'facturae_residence_type': 'R',
|
'facturae_residence_type': 'R',
|
||||||
'id_electronet': '101',
|
|
||||||
'organo_proponente': 'Test Organo Proponente',
|
'organo_proponente': 'Test Organo Proponente',
|
||||||
'organo_gestor': 'TEST',
|
'organo_gestor': 'TEST',
|
||||||
'unidad_tramitadora': 'TEST',
|
'unidad_tramitadora': 'TEST',
|
||||||
|
|
|
@ -6,7 +6,5 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<newline/>
|
<newline/>
|
||||||
<label name="electronet_sale_point"/>
|
<label name="electronet_sale_point"/>
|
||||||
<field name="electronet_sale_point"/>
|
<field name="electronet_sale_point"/>
|
||||||
<label name="id_electronet"/>
|
|
||||||
<field name="id_electronet"/>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</data>
|
</data>
|
||||||
|
|
Loading…
Reference in New Issue