Skip to content

Commit d9fbf17

Browse files
committed
[IMP] developer/reference/backend: domain operators
Simplify the list of operators and add `any!`. Part-of: #14105 Signed-off-by: Krzysztof Magusiak (krma) <[email protected]>
1 parent 5576dee commit d9fbf17

File tree

1 file changed

+8
-17
lines changed
  • content/developer/reference/backend

1 file changed

+8
-17
lines changed

content/developer/reference/backend/orm.rst

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -950,26 +950,20 @@ A domain can be a simple condition ``(field_expr, operator, value)`` where:
950950
``=?``
951951
unset or equals to (returns true if ``value`` is either ``None`` or
952952
``False``, otherwise behaves like ``=``)
953-
``=like``
953+
``=like`` (and ``not =like``)
954954
matches ``field_expr`` against the ``value`` pattern. An underscore
955955
``_`` in the pattern stands for (matches) any single character; a
956956
percent sign ``%`` matches any string of zero or more characters.
957-
``like``
957+
``like`` (and ``not like``)
958958
matches ``field_expr`` against the ``%value%`` pattern. Similar to
959959
``=like`` but wraps ``value`` with '%' before matching
960-
``not like``
961-
doesn't match against the ``%value%`` pattern
962-
``ilike``
960+
``ilike`` (and ``not ilike``)
963961
case insensitive ``like``
964-
``not ilike``
965-
case insensitive ``not like``
966-
``=ilike``
962+
``=ilike`` (and ``not =ilike``)
967963
case insensitive ``=like``
968-
``in``
964+
``in`` (and ``not in``)
969965
is equal to any of the items from ``value``, ``value`` should be a
970966
collection of items
971-
``not in``
972-
is unequal to all of the items from ``value``
973967
``child_of``
974968
is a child (descendant) of a ``value`` record (value can be either
975969
one item or a list of items).
@@ -984,17 +978,14 @@ A domain can be a simple condition ``(field_expr, operator, value)`` where:
984978
Takes the semantics of the model into account (i.e following the
985979
relationship field named by
986980
:attr:`~odoo.models.Model._parent_name`).
987-
``any``
981+
``any`` (and ``not any``)
988982
matches if any record in the relationship traversal through
989983
``field_expr`` (:class:`~odoo.fields.Many2one`,
990984
:class:`~odoo.fields.One2many`, or :class:`~odoo.fields.Many2many`)
991985
satisfies the provided domain ``value``.
992986
The ``field_expr`` should be a field name.
993-
``not any``
994-
matches if no record in the relationship traversal through
995-
``field_expr`` (:class:`~odoo.fields.Many2one`,
996-
:class:`~odoo.fields.One2many`, or :class:`~odoo.fields.Many2many`)
997-
satisfies the provided domain ``value``.
987+
``any!`` (and ``not any!``)
988+
like ``any``, but bypasses access checks.
998989

999990
* ``value``
1000991
variable type, must be comparable (through ``operator``) to the named

0 commit comments

Comments
 (0)