_constraint - altering data of the tested object
Hello!
the module can be found in
~openerp-
I am trying to set a default variable in the exception handler, (from lines 131 on)
The problem is, that a similar statement works for bank.statement.line but not for invoice.line nor account.move.line
the _constraint marked as FIXME in
chricar_
is executed for sure, because the following if statement does not fail.
Hence I have deactivated it for the moment.
So I do not know if this is a programming error
QUESTIONS:
1) Is it allowed to alter object data in _constraints ?
2) if yes
2a) How to return changed values in ALL cases
2b) Pls describe the workflow of _constraints
2c) Is it possible to return some information to the constraint message like "test A failed" or "test B failed"
the developer book is not helpful
***************
http://
_constraints
The constraints on the object. See the constraints section for details.
***************
I do not find a constraint section
the Example:
***************
class account_
_inherit = "account.
def _check_
for move in self.browse(cr, uid, ids):
# FIXME - does not write the found value
#if not move.account_
# move.account_
# return True
if not move.account_
if move.account_
return True
_constraints = [
'You must assign an analytic account using this account', ['account_
]
account_
*************
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Ferdinand for more information if necessary.