Skip to Content
Menu
This question has been flagged
3 Replies
10802 Views

<page name="entitlements" string="Entitlements">

 <field name="entitlement_ids" widget="one2many_list" nolabel="1"> 

 <tree string="Entitlements" editable="bottom" > 

 <field name="name" widget="selection" /> 

 <field name="asset_id" widget="selection" attrs="{'invisible':[('name','=','loan')]}" /> 

 <field name="loan_id" widget="selection" attrs="{'invisible':[('name','=','asset')]}" />

 </tree> 

 </field>

 </page> 


its make my field readonly but i want to hide my field not readonly                              

Avatar
Discard

Check odoo customization tips: http://learnopenerp.blogspot.com/

Best Answer

HI,

As in the answer of the Odoo tools, you might have to make necessary changes in the JS to achieve what you are looking for. You cannot hide the field for a single line based on condition, it will become readonly as you already got.


If possible you can hide the entire column rather than each lines, for that see the sample

<field name="qty_invoiced" attrs="{'column_invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>


Thanks

Avatar
Discard
Author

yes i want to hide entire column not row/ lines i try this code

<field name="asset_id" widget="selection" attrs="{'column_invisible': [('name', 'in', ['loan'])]}" />

i try this code

but error is

Uncaught TypeError: Cannot read property 'split' of undefined

Author

with parent coloms its working fine but with out parent its not working my selection on same line not on parent

Author

column_invisible only work with parent why ?

yes it will work based on the parent, how it can work based on the one2many lines as there are multiple record in it

Hello Niyas

When i used your code it's worked but this code hide entire column. and i need some specific rows so what i do

This 'column_invisible' attribute only works with 'parent.status' instead of 'status' only and also we cannot define our own domain, like [('product_id.status', '=', '2')], which is bit more restriction.

Best Answer

I guess, you can't find a field inside a tree view (perhaps, only with custom JavaScript). There might be just not empty cell inside. You can only make invisible the whole column.






THERE IS NO WAY TO HIDE THIS CELL



Avatar
Discard
Related Posts Replies Views Activity
0
Mar 15
3351
4
Feb 22
27074
1
Oct 15
9724
1
Aug 15
5073
1
Apr 15
3489