El 19/11/15 a les 12:04, Antonio Roncero ha escrit:
Hi,In a particular case, i need to make invisible the name field on the party model and use only code field. In this case i need to make visible a page. I use the classmethod view_attributes | @classmethod defview_attributes(cls): return[('/form//field[@name="name"]','states',{ 'invisible':Eval('is_robot'), }), ('//page[@id="party_robot_data"]','states',{ 'invisible':~Eval('is_robot'), }), ] | The second part works fine, but the field "name" not change. I tried with /form/field[@name="name"] /form//field[@name="name"] //form/field[@name="name"] //field[@name="name"] /field[@name="name"]... I don't know if I am writing bad the xpath or there is another error
Why are you only setting the states on the view and not on the field? I will override the states on name field, on the __setup__ function, so it's applied to all the views.
Also make sure that the is_robot field is added to the name depends, so the client will always fetch the is_robot field.
Hope it helps. -- Sergi Almacellas Abellana www.koolpi.com Twitter: @pokoli_srk -- 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/564DD985.4010900%40koolpi.com.
