Skip to content

Commit

Permalink
Merge pull request #712 from ursais/17.0-fix-l0n_mx_edi_addenda_audi
Browse files Browse the repository at this point in the history
[17.0] [FIX] l10n_mx_edi_addenda_audi: Add fields
  • Loading branch information
SMaciasOSI authored Jul 9, 2024
2 parents ae69791 + c956cef commit 4cf5d9c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
5 changes: 5 additions & 0 deletions l10n_mx_edi_addenda_audi/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class AccountMove(models.Model):
audi_business_unit = fields.Char(string="Business Unit")
audi_applicant_email = fields.Char(string="Applicant email")
audi_flag = fields.Boolean(compute="_compute_audi_flag", store=True)
audi_tax_code = fields.Char(string="Tax Code")
audi_fiscal_document_type = fields.Char(string="Fiscal Document Type")
audi_document_type = fields.Char(string="Document Type")
audi_supplier_email = fields.Char(string="Supplier Email")
audi_supplier_number = fields.Char(string="Supplier Number")

@api.depends("partner_id.l10n_mx_edi_addenda")
def _compute_audi_flag(self):
Expand Down
8 changes: 8 additions & 0 deletions l10n_mx_edi_addenda_audi/views/account_move.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
<group>
<field name="audi_business_unit" invisible="not audi_flag" />
<field name="audi_applicant_email" invisible="not audi_flag" />
<field name="audi_tax_code" invisible="not audi_flag" />
<field
name="audi_fiscal_document_type"
invisible="not audi_flag"
/>
<field name="audi_document_type" invisible="not audi_flag" />
<field name="audi_supplier_email" invisible="not audi_flag" />
<field name="audi_supplier_number" invisible="not audi_flag" />
</group>
</page>
</xpath>
Expand Down
14 changes: 6 additions & 8 deletions l10n_mx_edi_addenda_audi/views/l10n_mx_edi_addenda_audi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,26 @@
xmlns:S="http://www.Audi.net.mx/Addenda/S"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.Audi.net.mx/Addenda/S S.xsd"
codigoImpuesto="D2"
tipoDocumentoFiscal="FA"
t-att-codigoImpuesto="record.audi_tax_code"
t-att-tipoDocumentoFiscal="record.audi_fiscal_document_type"
version="1.0"
tipoDocumento="S"
t-att-tipoDocumento="record.audi_document_type"
>
<S:Moneda t-att-tipoMoneda="record.currency_id.name" />
<S:Proveedor
t-attf-noProveedor="00X7244100"
t-attf-eMail="[email protected]"
t-att-noProveedor="record.audi_supplier_number"
t-att-eMail="record.audi_supplier_email"
/>
<S:Referencias t-att-unidadNegocio="record.audi_business_unit" />
<S:Solicitante t-att-eMail="record.audi_applicant_email" />
<S:Partes>
<t t-set="i" t-value="1" />
<t t-set="unidad_medida" t-value="UP" />
<t t-set="codigo_impuesto" t-value="D2" />
<t t-foreach="record.invoice_line_ids" t-as="move_line">
<S:Parte
t-att-precioUnitario="move_line.price_unit"
t-att-numeroParte="move_line.audi_product_ref"
t-att-descripcion="move_line.product_id.name"
t-attf-codigoImpuesto="D2"
t-att-codigoImpuesto="record.audi_tax_code"
t-att-cantidad="move_line.quantity"
t-att-posicion="i"
t-att-montoLinea="move_line.price_unit * move_line.quantity"
Expand Down

0 comments on commit 4cf5d9c

Please sign in to comment.