From f607e239730e86b63332d1b4180a8ffed6f87fad Mon Sep 17 00:00:00 2001 From: FernandoRomera Date: Tue, 6 Aug 2024 10:37:50 +0200 Subject: [PATCH] [MIG] edi_voxel_account_invoice_oca: Migration to 17.0 --- edi_voxel_account_invoice_oca/__manifest__.py | 2 +- .../migrations/15.0.1.0.0/pre-migration.py | 34 ----------------- .../tests/test_voxel_account_invoice.py | 4 +- .../views/account_move_views.xml | 37 +++++++------------ .../views/res_config_settings_views.xml | 6 +-- 5 files changed, 17 insertions(+), 66 deletions(-) delete mode 100644 edi_voxel_account_invoice_oca/migrations/15.0.1.0.0/pre-migration.py diff --git a/edi_voxel_account_invoice_oca/__manifest__.py b/edi_voxel_account_invoice_oca/__manifest__.py index a598c98164..9df26bcab5 100644 --- a/edi_voxel_account_invoice_oca/__manifest__.py +++ b/edi_voxel_account_invoice_oca/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Voxel account invoice oca", "summary": "Sends account invoices to Voxel.", - "version": "15.0.1.0.2", + "version": "17.0.1.0.0", "development_status": "Production/Stable", "category": "Accounting & Finance", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/edi_voxel_account_invoice_oca/migrations/15.0.1.0.0/pre-migration.py b/edi_voxel_account_invoice_oca/migrations/15.0.1.0.0/pre-migration.py deleted file mode 100644 index 5711f330f7..0000000000 --- a/edi_voxel_account_invoice_oca/migrations/15.0.1.0.0/pre-migration.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2023 Tecnativa - Ernesto Tejeda -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openupgradelib import openupgrade - - -@openupgrade.migrate() -def migrate(env, version): - mapping_function_record_data = { - ( - "_get_and_send_voxel_report", - env.ref("edi_voxel_oca.channel_voxel_export").id, - ): "job_function_get_and_send_voxel_report", - ( - "_update_error_status", - env.ref("edi_voxel_oca.channel_voxel_status").id, - ): "job_function_update_error_status", - } - vals_list = [] - domain = [("model_id", "=", env.ref("account.model_account_move").id)] - function = env["queue.job.function"].search(domain) - for record in function: - key = (record.method, record.channel_id.id) - if key in mapping_function_record_data: - vals_list.append( - { - "noupdate": True, - "name": mapping_function_record_data[key], - "module": "edi_voxel_account_invoice_oca", - "model": "queue.job.function", - "res_id": record.id, - } - ) - env["ir.model.data"].create(vals_list) diff --git a/edi_voxel_account_invoice_oca/tests/test_voxel_account_invoice.py b/edi_voxel_account_invoice_oca/tests/test_voxel_account_invoice.py index 7b2dd01c0e..bb287cbce1 100644 --- a/edi_voxel_account_invoice_oca/tests/test_voxel_account_invoice.py +++ b/edi_voxel_account_invoice_oca/tests/test_voxel_account_invoice.py @@ -9,7 +9,7 @@ class TestVoxelAccountInvoice(TransactionCase): @classmethod def setUpClass(cls): - super(TestVoxelAccountInvoice, cls).setUpClass() + super().setUpClass() cls.env = cls.env( context=dict( cls.env.context, @@ -62,7 +62,7 @@ def setUpClass(cls): ) cls.env["product.customerinfo"].create( { - "name": partner.id, + "partner_id": partner.id, "product_tmpl_id": product_1.product_tmpl_id.id, "product_id": product_1.id, "product_code": "1234567891234", diff --git a/edi_voxel_account_invoice_oca/views/account_move_views.xml b/edi_voxel_account_invoice_oca/views/account_move_views.xml index 924d7f22b9..e4374441c3 100644 --- a/edi_voxel_account_invoice_oca/views/account_move_views.xml +++ b/edi_voxel_account_invoice_oca/views/account_move_views.xml @@ -4,28 +4,21 @@ account.move.form.inherit account.move -
@@ -33,7 +26,7 @@ @@ -56,7 +49,7 @@ name="voxel_requeue_sudo" string="Requeue" class="oe_highlight" - attrs="{'invisible': [('state', '!=', 'failed')]}" + invisible="state != 'failed'" />