From 3e808bea1ee6f66c4c618df40ec781bf1555075e Mon Sep 17 00:00:00 2001 From: DanielAPereyraB Date: Mon, 22 Jul 2024 09:18:32 -0400 Subject: [PATCH] [MIG] l10n_do_rnc_validation: Migration to 17.0 --- l10n_do_rnc_validation/__manifest__.py | 4 ++-- l10n_do_rnc_validation/models/res_partner.py | 15 +-------------- .../views/res_config_settings_views.xml | 10 +++++----- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/l10n_do_rnc_validation/__manifest__.py b/l10n_do_rnc_validation/__manifest__.py index 6234cd0..081429c 100644 --- a/l10n_do_rnc_validation/__manifest__.py +++ b/l10n_do_rnc_validation/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Dominican Tax ID Validation", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "summary": "Validate RNC/Cédula from external service", "category": "Extra Tools", "author": "Guavana," "Indexa," "Iterativo", @@ -15,5 +15,5 @@ "views/res_config_settings_views.xml", "data/ir_config_parameter_data.xml", ], - "installable": False, + "installable": True, } diff --git a/l10n_do_rnc_validation/models/res_partner.py b/l10n_do_rnc_validation/models/res_partner.py index 06dbfe7..b066e02 100644 --- a/l10n_do_rnc_validation/models/res_partner.py +++ b/l10n_do_rnc_validation/models/res_partner.py @@ -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): diff --git a/l10n_do_rnc_validation/views/res_config_settings_views.xml b/l10n_do_rnc_validation/views/res_config_settings_views.xml index ff16bca..a3acda6 100644 --- a/l10n_do_rnc_validation/views/res_config_settings_views.xml +++ b/l10n_do_rnc_validation/views/res_config_settings_views.xml @@ -6,18 +6,18 @@ - -
-
+ + +
-
+
-
+