Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions edi_core_oca/models/edi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]
Expand All @@ -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),
]
Expand Down Expand Up @@ -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),
]
Expand All @@ -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:
Expand Down
16 changes: 16 additions & 0 deletions edi_queue_oca/tests/test_backend_output_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
Loading