El 10/02/2014 17:26, <sunny14...@gmail.com> va escriure: > > Hi All, > > I am not able to set context in my module. > > In __setup__ method i am using cls._context_fields.insert(0, 'member'). > > But i am getting following trace when i update my module. > > AttributeError: type object 'my_module' has no attribute '_context_fields' > > please let us know how to set context field.
In __setup__() set the context.in the field you want. For example, set the context for "party" field: If not cls.party.context: cls.party.context = {} cls.party.context.update({ 'xx': Eval('yy'), 'zz': False, }) If 'yy' not in cls.party.depends: cls.party.depends.append('yy') I'm not sure if a field always have the context set, so first "if" is unnecessary. Guillem