Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

attrs invisible with more than 2 arguments or with != [Closed]

By
priyankahdp
on 4/9/13, 7:39 AM 5,670 views

The Question has been closed

by
priyankahdp
on 04/22/2013 04:55:36

here is my source code and i need to know hide bank_id field when i select != bank value from selection box ? I tried with

attrs="{'invisible': [('special_deduction_type', '!=', 'bank')]}"

also for all fields.but then many2one fields shows in out of layout.please refer the image

image description

<page string="Special Deductions">
<field name='special_deduction_ids' nolabel='1'>
<tree string='List' editable='bottom'>
<field name='deduction_id' invisible="1" />
<field name='special_deduction_type' />
<field name='bank_id'
attrs="{'invisible': [('special_deduction_type', '=', 'bank')]}" />
<field name='union_id'
attrs="{'invisible': [('special_deduction_type', '=', 'union')]}" />
<field name='insurance_id'
attrs="{'invisible': [('special_deduction_type', '=', 'insurance')]}" />
<field name='loan_id'
attrs="{'invisible': [('special_deduction_type', '=', 'loan')]}" />
</tree>
</field>
3

priyankahdp

--priyankahdp--
1089
| 5 5 6
Colombo, Sri Lanka
--priyankahdp--
Java Developer ORACLE Python J2EE Spring Hibernate Struts & Jquery............. :-)
priyankahdp
On 4/9/13, 8:32 AM
<page string="Special Deductions">
<field name='special_deduction_ids' nolabel='1'>
<tree string='List' editable='bottom'>
<field name='deduction_id' invisible="1" />
<field name='special_deduction_type' />
<field name='bank_id'
attrs="{'invisible': [('special_deduction_type','in',('loan','union','insurance'))]}"/>
<field name='union_id'
attrs="{'invisible': [('special_deduction_type','in',('bank','loan','insurance'))]}"/>
<field name='insurance_id'
attrs="{'invisible': [('special_deduction_type','in',('loan','union','bank'))]}"/>
<field name='loan_id'
attrs="{'invisible': [('special_deduction_type','in',('bank','union','insurance'))]}"/>

</tree>
</field>
<br />
<br />
</page>

Thanks friend @priyankahdp it's working good

Atul Kumar jain
on 4/28/14, 10:02 AM

u r welcome dear Atul

priyankahdp
on 4/29/14, 1:46 AM
1

saad

--saad--
1008
| 5 4 8
Casablanca, Morocco
--saad--
saad
On 4/9/13, 8:27 AM

Invisible attribute on treeview has the same behavior than readonly attribute.
If you want to hide a field, you should use the Invisible attribute in form view.

S@@D : Thanks friend :-)

priyankahdp
on 4/9/13, 9:56 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 4/9/13, 7:39 AM
Seen: 5670 times
Last updated: 2/16/16, 10:08 AM