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(