Skip to content

Commit

Permalink
Merge pull request #194 from indexa-git/17.0-mig-001-dp
Browse files Browse the repository at this point in the history
[17.0][MIG] l10n_do_rnc_validation: Migration to 17.0
  • Loading branch information
fernando-pcg authored Oct 25, 2024
2 parents e73870f + 9c26153 commit 7417610
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
2 changes: 1 addition & 1 deletion l10n_do_rnc_validation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"views/res_config_settings_views.xml",
"data/ir_config_parameter_data.xml",
],
"installable": False,
"installable": True,
}
15 changes: 1 addition & 14 deletions l10n_do_rnc_validation/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,7 @@

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

@api.model
def name_search(self, name, args=None, operator="ilike", limit=100):
res = super(ResPartner, self).name_search(
name, args=args, operator=operator, limit=100
)
if not res and name:
if len(name) in (9, 11):
partners = self.search([("vat", "=", name)])
else:
partners = self.search([("vat", "ilike", name)])
if partners:
res = partners.name_get()
return res
_rec_names_search = ['name', 'vat']

@api.model
def get_contact_data(self, vat):
Expand Down
10 changes: 5 additions & 5 deletions l10n_do_rnc_validation/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<field name="priority" eval="1000"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='integration']" position="inside">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<xpath expr="//block[@name='integration']" position="inside">
<setting class="col-12 col-lg-6">
<div>
<field name="l10_do_can_validate_rnc"/>
</div>
<div class="o_setting_right_pane">
<div>
<label for="l10_do_can_validate_rnc" string="Indexa API RNC data"/>
<div class="text-muted">
Get Contact data from Indexa API
</div>
</div>
</div>
</setting>
</xpath>
</field>
</record>
Expand Down

0 comments on commit 7417610

Please sign in to comment.