On 2016-08-16 11:29, Jon Levy wrote:
> I have a bit of code that calls ModelSQL.write([active_records], {values}) 
> and have found that it will write to a field even if that field is 
> readonly, per the `states` of the Model.  Is this the expected behavior, 
> and is there a way to have `write` honor the constraint set in `states`?

This is the expected behaviour for now.
The read-only had always meaning only for user but we should try to
enforce it, see https://bugs.tryton.org/issue4207

But if you need a really strong enforcement, you must override the write
method to raise an error in this case.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20160816193303.GG28334%40tetsuo.

Reply via email to