Skip to content

Commit

Permalink
Merge pull request #742 from ursais/17.0-fix-l10n_mx_edi_addenda_audi
Browse files Browse the repository at this point in the history
[FIX] l10n_mx_edi_addenda_audi
  • Loading branch information
SMaciasOSI authored Jul 22, 2024
2 parents 1ca1805 + 94c20f6 commit 2079c12
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 4 deletions.
1 change: 1 addition & 0 deletions l10n_mx_edi_addenda_audi/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"data": [
"views/account_move.xml",
"views/l10n_mx_edi_addenda_audi.xml",
"views/res_partner_views.xml",
],
"application": False,
}
1 change: 1 addition & 0 deletions l10n_mx_edi_addenda_audi/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import account_move
from . import account_move_line
from . import res_partner
2 changes: 0 additions & 2 deletions l10n_mx_edi_addenda_audi/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class AccountMove(models.Model):
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/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

audi_supplier_email = fields.Char(string="Supplier Email")
audi_supplier_number = fields.Char(string="Supplier Number")
2 changes: 0 additions & 2 deletions l10n_mx_edi_addenda_audi/views/account_move.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
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
20 changes: 20 additions & 0 deletions l10n_mx_edi_addenda_audi/views/res_partner_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<odoo>
<record id="view_res_partner_form_inherit_addenda_audi" model="ir.ui.view">
<field name="name">res.partner.form.inherit.addenda.audi</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='category_id']" position="after">
<field name="l10n_mx_edi_addenda_name" invisible="1" />
<field
name="audi_supplier_email"
invisible="not l10n_mx_edi_addenda_name == 'Addenda Audi'"
/>
<field
name="audi_supplier_number"
invisible="not l10n_mx_edi_addenda_name == 'Addenda Audi'"
/>
</xpath>
</field>
</record>
</odoo>

0 comments on commit 2079c12

Please sign in to comment.