From c40ffb39e42cb2357e7d76ba8eb7327692e513eb Mon Sep 17 00:00:00 2001 From: JordiMForgeFlow Date: Sat, 26 Oct 2024 16:18:38 +0200 Subject: [PATCH] fixup! [ADD] test-requirements --- edi_oca/models/edi_exchange_consumer_mixin.py | 6 ++++-- edi_oca/models/edi_exchange_record.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/edi_oca/models/edi_exchange_consumer_mixin.py b/edi_oca/models/edi_exchange_consumer_mixin.py index a771391aa..af2edf045 100644 --- a/edi_oca/models/edi_exchange_consumer_mixin.py +++ b/edi_oca/models/edi_exchange_consumer_mixin.py @@ -72,7 +72,9 @@ def _edi_get_exchange_type_config(self): eval_ctx = dict( self._get_eval_context(), record=self, exchange_type=exchange_type ) - domain = safe_eval.safe_eval(rule.enable_domain or "[]", eval_ctx) + domain = safe_eval.safe_eval( + rule.enable_domain or "[]", eval_ctx, nocopy=True + ) if not self.filtered_domain(domain): continue if rule.enable_snippet: @@ -252,7 +254,7 @@ def action_view_edi_records(self): # Purge default search filters from ctx to avoid hiding records ctx = action.get("context", {}) if isinstance(ctx, str): - ctx = safe_eval.safe_eval(ctx, self.env.context, nocopy=True) + ctx = safe_eval.safe_eval(ctx, self.env.context) action["context"] = { k: v for k, v in ctx.items() if not k.startswith("search_default_") } diff --git a/edi_oca/models/edi_exchange_record.py b/edi_oca/models/edi_exchange_record.py index 1070f4c3c..31ed472d9 100644 --- a/edi_oca/models/edi_exchange_record.py +++ b/edi_oca/models/edi_exchange_record.py @@ -509,7 +509,7 @@ def _search(self, domain, offset=0, limit=None, order=None): recs = self.env[model].browse(list(targets)) missing = recs - recs.exists() if missing: - if config["test_enable"]: + if not config["test_enable"]: # Not log warning in tests to prevent CI failing for res_id in missing.ids: _logger.warning(