Hi Dress
Try using this as example :
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
if not context: context = {}
res = super(your_class_name, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
#call your_function_here
doc = etree.XML(res['arch'])
if your_function_condition :
nodes_your_field_name = doc.xpath("//field[@name='your_field_name']")
for node in nodes_your_field_name:
node.set('invisible', 'True')
res['arch'] = etree.tostring(doc)
return res
Don't forget to import the library
from lxml import etree
post your code , that you have done so far