Skip to content
Closed
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
3 changes: 2 additions & 1 deletion odoo/orm/domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ def map_conditions(self, function: Callable[[DomainCondition], Domain]) -> Domai
def validate(self, model: BaseModel) -> None:
"""Validates that the current domain is correct or raises an exception"""
# just execute the optimization code that goes through all the fields
self._optimize(model, OptimizationLevel.FULL)
# the search domain is set to False to avoid performing searches
self._optimize(model.with_context(search_domain=Domain.FALSE), OptimizationLevel.FULL)

def _as_predicate[M: BaseModel](self, records: M) -> Callable[[M], bool]:
"""Return a predicate function from the domain (bound to records).
Expand Down