From 866d920b5bbd88445d873deef5d62524501a5f3a Mon Sep 17 00:00:00 2001 From: Jorge Conce Date: Mon, 26 Feb 2024 17:26:22 -0400 Subject: [PATCH 1/2] first commit --- Dockerfile | 2 +- l10n_do_currency_update/__manifest__.py | 4 ++-- l10n_do_ncf_validation/__manifest__.py | 4 ++-- l10n_do_rnc_validation/__manifest__.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index abd5694..c8119d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/iterativo/dockerdoo:15.0 +FROM gcr.io/iterativo/dockerdoo:16.0 ENV ODOO_EXTRA_ADDONS /mnt/extra-addons USER root RUN sudo mkdir -p ${ODOO_EXTRA_ADDONS} diff --git a/l10n_do_currency_update/__manifest__.py b/l10n_do_currency_update/__manifest__.py index 47cf35d..bcb61c8 100644 --- a/l10n_do_currency_update/__manifest__.py +++ b/l10n_do_currency_update/__manifest__.py @@ -7,7 +7,7 @@ "website": "https://www.indexa.do", "category": "Accounting", "license": "LGPL-3", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "depends": ["account"], "data": [ "data/ir_cron_data.xml", @@ -17,5 +17,5 @@ "demo": [ "demo/res_company_demo.xml", ], - "installable": True, + "installable": False, } diff --git a/l10n_do_ncf_validation/__manifest__.py b/l10n_do_ncf_validation/__manifest__.py index 88cdb6f..9f02f8a 100644 --- a/l10n_do_ncf_validation/__manifest__.py +++ b/l10n_do_ncf_validation/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Dominican NCF Validation", - "version": "15.0.1.0.1", + "version": "16.0.1.0.0", "summary": "Validate NCF from external service", "category": "Extra Tools", "license": "LGPL-3", @@ -11,5 +11,5 @@ "data/ir_config_parameter_data.xml", "views/res_config_settings_views.xml", ], - "installable": True, + "installable": False, } diff --git a/l10n_do_rnc_validation/__manifest__.py b/l10n_do_rnc_validation/__manifest__.py index b1097ff..6234cd0 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": "15.0.1.0.0", + "version": "16.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": True, + "installable": False, } From f39a80dc5a21fd5917286ea93ef633807b9fb65c Mon Sep 17 00:00:00 2001 From: Jorge Conce Date: Tue, 26 Mar 2024 16:03:10 -0400 Subject: [PATCH 2/2] [MIG] l10n_do_rnc_validation: v16 migration --- .github/workflows/tests.yaml | 3 +- l10n_do_rnc_validation/__manifest__.py | 2 +- l10n_do_rnc_validation/i18n/es_DO.po | 37 ++++---------- .../14.0.2.1.0/post-init_migrate_fields.py | 48 ------------------- l10n_do_rnc_validation/models/res_partner.py | 15 +----- 5 files changed, 12 insertions(+), 93 deletions(-) delete mode 100644 l10n_do_rnc_validation/migrations/14.0.2.1.0/post-init_migrate_fields.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ef5a6e7..a1a9640 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -72,8 +72,7 @@ jobs: with: repository: indexa-git/l10n-dominicana path: l10n-dominicana - # TODO change this to ${{ env.GITHUB_BASE_REF_SLUG || env.GITHUB_REF_SLUG }} - ref: '15.0-mig' + ref: '${{ env.GITHUB_BASE_REF_SLUG || env.GITHUB_REF_SLUG }}' - name: Select Odoo modules to install id: get_modules 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):