mirror of
https://github.com/NaN-tic/trytond-account_invoice_facturae_electronet.git
synced 2023-12-14 04:12:59 +01:00
parent
486dc84d3c
commit
80d8f1773f
|
@ -580,6 +580,12 @@
|
|||
<xs:documentation xml:lang="es"> Número de secuencia o línea del pedido. </xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="DeliveryNotesCode" type="DeliveryNotesReferencesType" minOccurs="0">
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en"> Delivery notes codes.</xs:documentation>
|
||||
<xs:documentation xml:lang="es"> Códigos de albaranes. </xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="DeliveryNotesReferences" type="DeliveryNotesReferencesType" minOccurs="0">
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en"> Delivery notes references.</xs:documentation>
|
||||
|
@ -3417,4 +3423,4 @@
|
|||
</xs:enumeration>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
||||
</xs:schema>
|
||||
|
|
|
@ -11,4 +11,5 @@ def register():
|
|||
invoice.Invoice,
|
||||
invoice.GenerateFacturaeStart,
|
||||
party.Party,
|
||||
party.Address,
|
||||
module='account_invoice_facturae_electronet', type_='model')
|
||||
|
|
|
@ -60,6 +60,11 @@ class Invoice(metaclass=PoolMeta):
|
|||
'party': party.rec_name,
|
||||
'field': 'ID Electronet'
|
||||
})
|
||||
elif not self.invoice_address.electronet_sale_point:
|
||||
self.raise_user_error('missing_facturae_party_info', {
|
||||
'party': party.rec_name,
|
||||
'field': 'Electronet Sale Point'
|
||||
})
|
||||
|
||||
jinja_env = Environment(
|
||||
loader=FileSystemLoader(MODULE_PATH),
|
||||
|
|
7
party.py
7
party.py
|
@ -3,10 +3,15 @@
|
|||
from trytond.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = ['Party']
|
||||
__all__ = ['Party', 'Address']
|
||||
|
||||
|
||||
class Party(metaclass=PoolMeta):
|
||||
__name__ = 'party.party'
|
||||
|
||||
id_electronet = fields.Char('Id Electronet')
|
||||
|
||||
class Address(metaclass=PoolMeta):
|
||||
__name__ = 'party.address'
|
||||
|
||||
electronet_sale_point = fields.Char('Electronet Sale Point')
|
||||
|
|
|
@ -8,5 +8,10 @@
|
|||
<field name="inherit" ref="party.party_view_form"/>
|
||||
<field name="name">party_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="address_view_form">
|
||||
<field name="model">party.address</field>
|
||||
<field name="inherit" ref="party.address_view_form"/>
|
||||
<field name="name">address_form</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
</tryton>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% from "template_facturae_macros.xml" import administrative_center, address, contact %}<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
{% from "template_facturae_macros.xml" import administrative_center, address, contact %}
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<namespace:Facturae xmlns:namespace2="http://uri.etsi.org/01903/v1.2.2#" xmlns:namespace3="http://www.w3.org/2000/09/xmldsig#" xmlns:namespace="http://www.facturae.es/Facturae/2009/v3.2/Facturae">
|
||||
<FileHeader>
|
||||
<SchemaVersion>3.2</SchemaVersion>
|
||||
|
@ -70,7 +71,7 @@
|
|||
{% if invoice.party.oficina_contable %}{{ administrative_center(invoice.party.oficina_contable, '01', invoice.party) }}{% endif %}
|
||||
{% if invoice.party.organo_gestor %}{{ administrative_center(invoice.party.organo_gestor, '02', invoice.party) }}{% endif %}
|
||||
{% if invoice.party.unidad_tramitadora %}{{ administrative_center(invoice.party.unidad_tramitadora, '03', invoice.party) }}{% endif %}
|
||||
{% if invoice.party.organo_proponente %}{{ administrative_center(invoice.party.organo_proponente, '04', invoice.party) }}{% endif %}
|
||||
{% if invoice.invoice_address.electronet_sale_point %}{{ administrative_center(invoice.invoice_address.electronet_sale_point, '04', invoice.party) }}{% endif %}
|
||||
</AdministrativeCentres>
|
||||
<LegalEntity>
|
||||
<CorporateName>{{ invoice.party.name and invoice.party.name[:80] or invoice.party.code[:80] }}</CorporateName>
|
||||
|
@ -215,6 +216,22 @@
|
|||
- TransactionDate
|
||||
- Extensions
|
||||
#}
|
||||
{% if line.shipments %}
|
||||
<DeliveryNotesCode>
|
||||
{% for shipment in line.shipments %}
|
||||
<DeliveryNote>
|
||||
<DeliveryNoteNumber>{{ shipment.number or '' }}</DeliveryNoteNumber>
|
||||
</DeliveryNote>
|
||||
{% endfor %}
|
||||
</DeliveryNotesCode>
|
||||
<DeliveryNotesReferences>
|
||||
{% for shipment in line.shipments %}
|
||||
<DeliveryNote>
|
||||
<DeliveryNoteNumber>{{ shipment.reference or '' }}</DeliveryNoteNumber>
|
||||
</DeliveryNote>
|
||||
{% endfor %}
|
||||
</DeliveryNotesReferences>
|
||||
{% endif %}
|
||||
<ItemDescription>{{ line.description and line.description[:2500] or '' }}</ItemDescription>
|
||||
<Quantity>{{ line.quantity }}</Quantity>
|
||||
<UnitOfMeasure>{{ UOM_CODE2TYPE.get(line.unit.symbol, '05') if line.unit else '05' }}</UnitOfMeasure>
|
||||
|
|
|
@ -3,5 +3,6 @@ version=4.9.0
|
|||
depends:
|
||||
ir
|
||||
account_invoice_facturae
|
||||
account_invoice_sale_relation
|
||||
xml:
|
||||
party.xml
|
||||
party.xml
|
||||
|
|
10
view/address_form.xml
Normal file
10
view/address_form.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/field[@name='subdivision']" position="after">
|
||||
<newline/>
|
||||
<label name="electronet_sale_point"/>
|
||||
<field name="electronet_sale_point"/>
|
||||
</xpath>
|
||||
</data>
|
Loading…
Reference in a new issue