From a9114c8ecacb176e5c04f40803b2b977c0dac7aa Mon Sep 17 00:00:00 2001 From: Hector Vior Date: Mon, 18 May 2026 09:18:42 +0200 Subject: [PATCH 1/2] [IMP] edi_core_oca: skip exchange types w/o handler in cron domains --- edi_core_oca/models/edi_backend.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/edi_core_oca/models/edi_backend.py b/edi_core_oca/models/edi_backend.py index d4af65ff6..937a143d5 100644 --- a/edi_core_oca/models/edi_backend.py +++ b/edi_core_oca/models/edi_backend.py @@ -370,6 +370,8 @@ def _output_new_records_domain(self, record_ids=None): ("backend_id", "=", self.id), ("type_id.exchange_file_auto_generate", "=", True), ("type_id.direction", "=", "output"), + ("type_id.generate_model_id", "!=", False), + ("type_id.send_model_id", "!=", False), ("edi_exchange_state", "=", "new"), ("exchange_file", "=", False), ] @@ -388,6 +390,7 @@ def _output_pending_records_domain(self, skip_sent=True, record_ids=None): states += ("output_sent",) domain = [ ("type_id.direction", "=", "output"), + ("type_id.send_model_id", "!=", False), ("backend_id", "=", self.id), ("edi_exchange_state", "in", states), ] @@ -575,6 +578,7 @@ def _input_pending_records_domain(self, record_ids=None): domain = [ ("backend_id", "=", self.id), ("type_id.direction", "=", "input"), + ("type_id.receive_model_id", "!=", False), ("edi_exchange_state", "=", "input_pending"), ("exchange_file", "=", False), ] @@ -587,6 +591,7 @@ def _input_pending_process_records_domain(self, record_ids=None): domain = [ ("backend_id", "=", self.id), ("type_id.direction", "=", "input"), + ("type_id.process_model_id", "!=", False), ("edi_exchange_state", "in", states), ] if record_ids: From 2134f83ec51db842098310e2383b84a1d74bcacb Mon Sep 17 00:00:00 2001 From: Hector Vior Date: Mon, 18 May 2026 09:18:44 +0200 Subject: [PATCH 2/2] [FIX] edi_queue_oca: set handler models in test to match cron domain filter --- edi_queue_oca/tests/test_backend_output_jobs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/edi_queue_oca/tests/test_backend_output_jobs.py b/edi_queue_oca/tests/test_backend_output_jobs.py index b600a0d9b..7c611d4a2 100644 --- a/edi_queue_oca/tests/test_backend_output_jobs.py +++ b/edi_queue_oca/tests/test_backend_output_jobs.py @@ -4,6 +4,7 @@ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). +from odoo.orm.model_classes import add_to_registry from odoo.tests import tagged from odoo.addons.edi_core_oca.tests.common import EDIBackendCommonTestCase @@ -12,6 +13,21 @@ @tagged("-at_install", "post_install") class EDIBackendTestOutputJobsCase(EDIBackendCommonTestCase): + @classmethod + def _setup_records(cls): # pylint:disable=missing-return + super()._setup_records() + from odoo.addons.edi_core_oca.tests.fake_models import EdiTestExecution + + add_to_registry(cls.registry, EdiTestExecution) + cls.registry._setup_models__(cls.env.cr, ["edi.framework.test.execution"]) + cls.registry.init_models( + cls.env.cr, ["edi.framework.test.execution"], {"models_to_check": True} + ) + cls.addClassCleanup(cls.registry.__delitem__, "edi.framework.test.execution") + model = cls.env["ir.model"]._get("edi.framework.test.execution") + cls.exchange_type_out.generate_model_id = model + cls.exchange_type_out.send_model_id = model + @classmethod def setUpClass(cls): super().setUpClass()