server-tools/base_domain_inverse_function/readme/USAGE.rst

14 lines
394 B
ReStructuredText

If you have to decompose a complex domain to inject some conditions,
this shows what you can do:
.. code-block:: python
from odoo.osv.expression import AND, OR
from odoo.addons.base_domain_inverse_function.expression import inverse_AND, inverse_OR
domain = AND([d1, d2, d3])
d1, d2, d3 = inverse_AND(domain)
domain = OR([d1, d2, d3])
d1, d2, d3 = inverse_OR(domain)