mirror of
https://github.com/odoo/documentation.git
synced 2026-01-04 02:36:32 +07:00
[IMP] orm: api.constraint deferred
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user