← Back to team overview

openerp-india team mailing list archive

[Bug 1075915] Re: on orm _validate calling any constraint method without context param

 

The validation code should not use the context: validation depends on
the records data only. Calling it twice with different contexts would
have to have the exact same behavior.

Validation error are created outside the call to the _constraints
functions, where the context is avalable and thus are translated.

_constraints functions have complete access to the written/created
records data at the very end of the write/create methods. If you want to
fill anything in, you can do so in the write/create methods.

** Changed in: openobject-server
       Status: Fix Committed => Invalid

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1075915

Title:
  on orm _validate calling any constraint method without context param

Status in OpenERP Server:
  Invalid

Bug description:
  Hello

  Please see osv/orm.py line 1447. _validate method calling constraint
  method without any context parameter.

  It's mostly seems okay. But some constraint method has raising
  exceptions (warning messages).

  If it doesn't pass context parameter then error messages cannot be
  translated ever.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1075915/+subscriptions


References