Created on 2022-05-16.13:23:28 by acaubet, last changed 3 months ago by reviewbot.
After asking on IRC, you mention a interesting fact that can be included on docs https://www.tryton.org/~irclog/2021-12-29.log.html#t13:12.
In case someone needs to change an attribute on the states but this attribute is set on core module, the change won't take action as the attributes have preference over the states.
So if you want to overwrite with:
cls.number.states['readonly'] = (Eval('state') != 'draft')
You need to do the following if the core module sets
cls.number.readonly = False cls.number.states['readonly'] = (Eval('state') != 'draft')
I do not understand what this is about?
So it's interesting to note that on docs
As this can not work if the attribute is directly defined on the field.
cls.<field name>.states['readonly'] = <PYSON expresion>
You need to do:
cls.<field name>.readonly = <PYSON expresion>
|2022-08-11 13:46:28||reviewbot||set||messages: + msg77672|
|2022-06-22 10:37:58||reviewbot||set||messages: + msg77202|
|2022-06-21 11:37:03||reviewbot||set||messages: + msg77191|
|2022-06-20 11:36:20||reviewbot||set||messages: + msg77134|
|2022-05-16 14:57:20||acaubet||set||messages: + msg76675|
nosy: + reviewbot
nosy: + ced
status: in-progress -> testing
Showing 10 items. Show all history (warning: this could be VERY long)