Hide Field in Tree view
In tree view we know how to put domain or attrs to visible or invisible any field,But, if we want to hide particular field in tree view based on type or state means based on any condition , then its hard to hide as we cannot use attrs to hide as attrs hide only value not a field.
So, its need to put some condition like below as its get value from context and check.
invisible="context.get('picking_type', False) in ['in']"
Version : V8
..Enjoy..
its help full..!!!
ReplyDeletethnks lot
Like to check. How can I do this in Odoo 8 to hide a column based on state?
ReplyDeleteI have tried this, but it didn't work. Any idea?
I have tried this too but it didn't work either
Any help? Thanks.
The codes seems missing... anyway a repost here
DeleteI have removed left and right angle brackets.
field name="price_unit" invisible="context.get('state', True) in ['draft']"
field name=”price_unit” invisible=”context.get(‘state’) == ‘draft’"
Same, not working in odoo8
ReplyDeleteThis comment has been removed by the author.
DeleteThe context can only be filled with [True / False]
Deletein xml : "< field name="pct_of_inv" invisible="context.get('is_lines', True)" / > "
in python :
if wizard.advance_payment_method == 'pct_lines':
res['context'] = {'is_lines':False }
return res
if wizard.advance_payment_method == 'lines':
res['context'] = {'is_lines':True}
return res
in odoo 9 too...
ReplyDeletethanks, you save my day. keep it up
ReplyDeletenot working in odoo 10
ReplyDeleteThank you for sharing the information and please keep sharing the information.
ReplyDeleteAccountants in barking
nothing working for me anyone to help
ReplyDelete