how can change field name based on condition in xml file?
my code is:
<field name="parent_id" position="attributes"> <attribute name="string">{'hod':[('is_student','=',true)]}</attribute> </field>
if field is_student true, show hod otherwise keep manager only.
how achieve it?
as not able in xml file, because if try @odedra solution, design getting disturbed.
i'm achieve code:
def fields_get(self, cr, uid, fields=none, context=none): if context none: context={} res = super(hr_employee, self).fields_get(cr, uid, fields, context) if 'parent_id' in res , 'is_student' in context , context['is_student']: if 'string' in res['parent_id']: res['parent_id']['string'] = 'hod' return res
Comments
Post a Comment