diff --git a/edi_voxel_oca/__manifest__.py b/edi_voxel_oca/__manifest__.py index a7a27ae222..964e90032b 100644 --- a/edi_voxel_oca/__manifest__.py +++ b/edi_voxel_oca/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Voxel", "summary": "Base module for connecting with Voxel", - "version": "15.0.1.0.0", + "version": "17.0.1.0.0", "development_status": "Production/Stable", "category": "Hidden", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/edi_voxel_oca/migrations/15.0.1.0.0/pre-migration.py b/edi_voxel_oca/migrations/15.0.1.0.0/pre-migration.py deleted file mode 100644 index 54e6ffeb0a..0000000000 --- a/edi_voxel_oca/migrations/15.0.1.0.0/pre-migration.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2023 Tecnativa - Ernesto Tejeda -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openupgradelib import openupgrade - -mapping_channel_record_data = { - "voxel_export": "channel_voxel_export", - "voxel_import": "channel_voxel_import", - "voxel_status": "channel_voxel_status", -} - - -@openupgrade.migrate() -def migrate(env, version): - vals_list = [] - domain = [ - ("name", "in", list(mapping_channel_record_data.keys())), - ("parent_id", "=", env.ref("queue_job.channel_root").id), - ] - for channel in env["queue.job.channel"].search(domain): - vals_list.append( - { - "noupdate": True, - "name": mapping_channel_record_data[channel.name], - "module": "edi_voxel_oca", - "model": "queue.job.channel", - "res_id": channel.id, - } - ) - env["ir.model.data"].create(vals_list) diff --git a/edi_voxel_oca/models/voxel_mixin.py b/edi_voxel_oca/models/voxel_mixin.py index 9c65d69bdc..498b3ee847 100644 --- a/edi_voxel_oca/models/voxel_mixin.py +++ b/edi_voxel_oca/models/voxel_mixin.py @@ -101,10 +101,14 @@ def _update_voxel_export_status(self, company): queue_obj = self.env["queue.job"].sudo() # Determine processed documents filenames = self._list_voxel_document_filenames("Outbox", company) - processed = sent_docs.filtered(lambda r: r.voxel_filename not in filenames) + processed = sent_docs.filtered( + lambda r, filenames=filenames: r.voxel_filename not in filenames + ) # Determine documents with errors filenames = self._list_voxel_document_filenames("Error", company) - with_errors = processed.filtered(lambda r: r.voxel_filename in filenames) + with_errors = processed.filtered( + lambda r, filenames=filenames: r.voxel_filename in filenames + ) doc_dict = {} for doc in with_errors: if doc.voxel_filename: @@ -118,7 +122,10 @@ def _update_voxel_export_status(self, company): # If not, create it file_job = queue_obj.search( [("channel", "=", "root.voxel_status")] - ).filtered(lambda r: r.args == [filename, company])[:1] + ).filtered( + lambda r, filename=filename, company=company: r.args + == [filename, company] + )[:1] if not file_job: error_msg = ( document.with_context(company_id=company.id) @@ -160,7 +167,10 @@ def enqueue_import_voxel_documents(self, company): # If not, create it file_job = queue_job_obj.search( [("channel", "=", "root.voxel_import")] - ).filtered(lambda r: r.args == [voxel_filename, company])[:1] + ).filtered( + lambda r, voxel_filename=voxel_filename, company=company: r.args + == [voxel_filename, company] + )[:1] if not file_job: self.with_context( company_id=company.id diff --git a/edi_voxel_oca/security/voxel_security.xml b/edi_voxel_oca/security/voxel_security.xml index 48574e67e8..8650e4e91d 100644 --- a/edi_voxel_oca/security/voxel_security.xml +++ b/edi_voxel_oca/security/voxel_security.xml @@ -23,8 +23,6 @@ Voxel login multi-company - ['|',('company_id','=',False),('company_id','in',company_ids)] + [('company_id', 'in', company_ids + [False])] diff --git a/edi_voxel_oca/views/res_company_view.xml b/edi_voxel_oca/views/res_company_view.xml index 2d002f0e51..835e3f77a0 100644 --- a/edi_voxel_oca/views/res_company_view.xml +++ b/edi_voxel_oca/views/res_company_view.xml @@ -6,17 +6,16 @@ res.company.voxel.form res.company - - + @@ -30,19 +29,19 @@ diff --git a/edi_voxel_oca/views/res_config_settings_views.xml b/edi_voxel_oca/views/res_config_settings_views.xml index acbe424152..c0cbc0c029 100644 --- a/edi_voxel_oca/views/res_config_settings_views.xml +++ b/edi_voxel_oca/views/res_config_settings_views.xml @@ -32,7 +32,7 @@