[IMP] orm: api.constraint deferred

This commit is contained in:
Rémy Voet (ryv)
2025-02-04 11:37:08 +01:00
parent eb23ae569f
commit a52f44829e
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