Skip to Content
Menu
This question has been flagged
3 Replies
11810 Zobrazenia

<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
Zrušiť

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
Zrušiť
Autor

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

Autor

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

Autor

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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
0
mar 15
4132
4
feb 22
29157
1
okt 15
10709
1
aug 15
6023
1
apr 15
4196