On 2015-06-23 01:09, [email protected] wrote: > Hi, > > I want to change a button caption and set him to readonly bei clicking on > it. > But in the method: > > @classmethod > @ModelView.button > def myButton(cls, records): > > > i have no access to the button himself. Is it possible to get the button and > edit them in this function?
Buttons don't have an internal state but you can define a states which can be 'readonly' using a PYSON statement. See: http://doc.tryton.org/3.6/trytond/doc/ref/models/models.html?highlight=_buttons#trytond.model.ModelView._buttons and for states description: http://doc.tryton.org/3.6/trytond/doc/ref/models/fields.html?highlight=states#trytond.model.fields.Field.states -- Cédric Krier - B2CK SPRL Email/Jabber: [email protected] Tel: +32 472 54 46 59 Website: http://www.b2ck.com/
