Compare commits

...

1 Commits

Author SHA1 Message Date
Rémy Voet (ryv)
a52f44829e [IMP] orm: api.constraint deferred 2025-12-10 16:20:11 +01:00
2 changed files with 5 additions and 4 deletions

View File

@@ -803,9 +803,10 @@ In a similar way, you can add more complex
A Python constraint is defined as a method decorated with
:func:`~odoo.api.constrains`, and invoked on a recordset. The decorator
specifies which fields are involved in the constraint, so that the constraint is
automatically evaluated when one of them is modified. The method is expected to
raise an exception if its invariant is not satisfied::
specifies which fields are involved in the constraint. The constraint is
automatically evaluated at the end of transaction when any of these fields
are modified. The method is expected to raise an exception if its invariant
is not satisfied::
from odoo.exceptions import ValidationError

View File

@@ -86,7 +86,7 @@ to make more complex checks which require Python code. In this case we need a Py
A Python constraint is defined as a method decorated with
:func:`~odoo.api.constrains` and is invoked on a recordset. The decorator
specifies which fields are involved in the constraint. The constraint is automatically evaluated
when any of these fields are modified . The method is expected to
at the end of transaction when any of these fields are modified. The method is expected to
raise an exception if its invariant is not satisfied::
from odoo.exceptions import ValidationError