Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
11681 Vistas

<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
Descartar

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

Mejor respuesta

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
Descartar
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.

Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
mar 15
3995
4
feb 22
28953
1
oct 15
10551
1
ago 15
5913
1
abr 15
4088