diff --git a/l10n_do_rnc_validation/__manifest__.py b/l10n_do_rnc_validation/__manifest__.py index 6234cd0..38e7df5 100644 --- a/l10n_do_rnc_validation/__manifest__.py +++ b/l10n_do_rnc_validation/__manifest__.py @@ -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/i18n/es_DO.po b/l10n_do_rnc_validation/i18n/es_DO.po index c8cee70..49781bd 100644 --- a/l10n_do_rnc_validation/i18n/es_DO.po +++ b/l10n_do_rnc_validation/i18n/es_DO.po @@ -4,18 +4,18 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 15.0\n" +"Project-Id-Version: Odoo Server 16.0+e\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-22 23:41+0000\n" -"PO-Revision-Date: 2021-10-22 19:42-0400\n" +"POT-Creation-Date: 2024-03-26 19:32+0000\n" +"PO-Revision-Date: 2024-03-26 15:33-0400\n" "Last-Translator: \n" "Language-Team: \n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" -"Language: es_DO\n" -"X-Generator: Poedit 3.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.4.2\n" #. module: l10n_do_rnc_validation #: model:ir.model,name:l10n_do_rnc_validation.model_res_company @@ -32,43 +32,23 @@ msgstr "Opciones de configuración" msgid "Contact" msgstr "Contacto" -#. module: l10n_do_rnc_validation -#: model:ir.model.fields,field_description:l10n_do_rnc_validation.field_res_company__display_name -#: model:ir.model.fields,field_description:l10n_do_rnc_validation.field_res_config_settings__display_name -#: model:ir.model.fields,field_description:l10n_do_rnc_validation.field_res_partner__display_name -msgid "Display Name" -msgstr "Nombre mostrado" - #. module: l10n_do_rnc_validation #: model_terms:ir.ui.view,arch_db:l10n_do_rnc_validation.res_config_settings_view_form_inherited msgid "Get Contact data from Indexa API" msgstr "Obtener datos de contacto de la API de Indexa" -#. module: l10n_do_rnc_validation -#: model:ir.model.fields,field_description:l10n_do_rnc_validation.field_res_company__id -#: model:ir.model.fields,field_description:l10n_do_rnc_validation.field_res_config_settings__id -#: model:ir.model.fields,field_description:l10n_do_rnc_validation.field_res_partner__id -msgid "ID" -msgstr "ID (identificación)" - #. module: l10n_do_rnc_validation #: model_terms:ir.ui.view,arch_db:l10n_do_rnc_validation.res_config_settings_view_form_inherited msgid "Indexa API RNC data" msgstr "Datos de Indexa API RNC" -#. module: l10n_do_rnc_validation -#: model:ir.model.fields,field_description:l10n_do_rnc_validation.field_res_company____last_update -#: model:ir.model.fields,field_description:l10n_do_rnc_validation.field_res_config_settings____last_update -#: model:ir.model.fields,field_description:l10n_do_rnc_validation.field_res_partner____last_update -msgid "Last Modified on" -msgstr "Última modificación en" - #. module: l10n_do_rnc_validation #: model_terms:ir.ui.view,arch_db:l10n_do_rnc_validation.l10n_do_external_validation_rnc_view_partner_form msgid "Name, RNC or Cédula" msgstr "Nombre, RNC o Cédula" #. module: l10n_do_rnc_validation +#. odoo-python #: code:addons/l10n_do_rnc_validation/models/res_partner.py:0 #, python-format msgid "No serializable data from API response" @@ -77,9 +57,10 @@ msgstr "No hay datos serializables de la respuesta de la API" #. module: l10n_do_rnc_validation #: model_terms:ir.ui.view,arch_db:l10n_do_rnc_validation.l10n_do_external_validation_rnc_view_res_partner_filter msgid "RNC/Cédula" -msgstr "" +msgstr "RNC/Cédula" #. module: l10n_do_rnc_validation +#. odoo-python #: code:addons/l10n_do_rnc_validation/models/res_partner.py:0 #, python-format msgid "RNC/Cédula %s is already assigned to %s" diff --git a/l10n_do_rnc_validation/migrations/14.0.2.1.0/post-init_migrate_fields.py b/l10n_do_rnc_validation/migrations/14.0.2.1.0/post-init_migrate_fields.py deleted file mode 100644 index 3f220ea..0000000 --- a/l10n_do_rnc_validation/migrations/14.0.2.1.0/post-init_migrate_fields.py +++ /dev/null @@ -1,48 +0,0 @@ -import logging -from odoo import api, SUPERUSER_ID - -_logger = logging.getLogger(__name__) - - -def migrate_old_fields(env): - """ - can_validate_rnc ----> l10_do_can_validate_rnc - """ - - env.cr.execute( - """ - SELECT EXISTS( - SELECT - FROM information_schema.columns - WHERE table_name = 'res_company' - AND column_name = 'can_validate_rnc' - ); - """ - ) - if env.cr.fetchone()[0] or False: - _logger.info( - """ - Migrating fields: - can_validate_rnc ----> l10_do_can_validate_rnc - """ - ) - for company in env["res.company"].search([]): - query = """ - UPDATE res_company - SET l10_do_can_validate_rnc = can_validate_rnc - WHERE id = %s; - """ - env.cr.execute(query % company.id) - - _logger.info("Dropping deprecated columns") - drop_query = """ - ALTER TABLE res_company - DROP COLUMN can_validate_rnc; - """ - env.cr.execute(drop_query) - - -def migrate(cr, version): - - env = api.Environment(cr, SUPERUSER_ID, {}) - migrate_old_fields(env) 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):