Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3 Antworten
11805 Ansichten

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

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

Beste Antwort

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

Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
März 15
4132
4
Feb. 22
29157
1
Okt. 15
10707
1
Aug. 15
6022
1
Apr. 15
4195