Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0] [FIX] l10n_mx_edi_addenda_audi: Add fields #712

Merged
merged 4 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
25 changes: 25 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,31 @@
<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"
placeholder="e.g. D2"
/>
<field
name="audi_fiscal_document_type"
invisible="not audi_flag"
placeholder="e.g. FA"
/>
<field
name="audi_document_type"
invisible="not audi_flag"
placeholder="e.g. S"
/>
<field
name="audi_supplier_email"
invisible="not audi_flag"
placeholder="e.g. [email protected]"
/>
<field
name="audi_supplier_number"
invisible="not audi_flag"
placeholder="e.g. 00X7244100"
/>
</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
Loading