I have a many2one field into tab(Notebook/page/tree) like this
so I make a method on_changed on this field when I change the value field I want to hide some column in this tree based on condition
this is my xml Code
<page string="page_name">
<field name="lines" context="{'academic_year_id' : academic_year_id}" >
<tree name="T1" editable="top">
<field name="field1"/>
<field name="field2"
domain="[('academic_year_id','=',parent.academic_year_id('id','=',parent.period_id)]/>
<field name="field3"/>
<field name="field4"/>
</tree>
</field>
</page>
and this is my code python
@api.onchange('field_to_change')
def onchange_program(self):
domain = {}
if self.field1:
//code
return {'domain': {'lines ' : [('field1 ', '=',False),('field2 ', '=',False),('field3 ', '=',False),('field4 ', '=',False)]}}
Overall, I want to make something like, domain in fields of tree on this page it's possible ?? Version odoo 8 thanks .