Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
11804 Weergaven

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

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

Beste antwoord

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
Annuleer
Auteur

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

Auteur

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

Auteur

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.

Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
mrt. 15
4132
4
feb. 22
29157
1
okt. 15
10707
1
aug. 15
6022
1
apr. 15
4195