I have some fields I'm showing in my One2many
tree view:
<page string="Budget Lines Planned">
<field name="account_budget_bsi_line" colspan="4" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
<tree string="Budget Lines Planned" editable="bottom" >
<field name="opening_stock"/>
<field name="sales_planned" />
<field name="amount_total"/>
<field name="interauxiliary_transfers_planned" />
<field name="interauxiliary_receipts_planned" />
<field name="prod_purchased_planned" />
<field name="closing_stock_planned" />
</tree>
</field>
</page>
This is from a custom module, which has a workflow with states, ie: draft, approved, next, done
etc.
Suppose on next
state, I want to hide opening_stock
field, and show some other field.
I know this can be achieved on forms by using attrs="{'readonly':[('state','!=','draft')]}"
or invisible or whatever.
But doesn't seem to work on One2many
tree views, so, how can I achieve that in this case?