Odoo Help


how to trigger Boolean field to show new form

Rahul Nimgade
on 8/12/16, 2:12 AM 165 views

Hello All,

i want to make one boolean field when i clicked(checked) it open new form...please anyone help me to solve this

eg: if i create two fields warranty_active, warranty_expired ,   so when i check for warranty_active then select_warranty_period should be show...if i select expired then not

Thank you....!

You just want to show one extra field i.e. select_warranty_period on click of boolean field right?

Asmita Chavan
on 8/12/16, 7:35 AM
Asmita Chavan
On 8/12/16, 8:08 AM

Ok, If you will observe the xml code in Product view for Sales tab:

<page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales">

here, sale_ok is Boolean field in product.product model, and in attrs it is written to make field invisible when value of sale_ok is False.


In your case:

If you want to make field invisible, on click of warranty_active field :

Then you have to write ,

<field name="select_warranty_period" attrs="{'invisible': [('warranty_active', '=', False)]}">

Ajeet Yadav
On 8/12/16, 8:43 AM

You need to add attrs in view when boolean field will checked warranty_expired will be visible.

<field name="warranty_expired" attrs="{'invisible':[('warranty_active','=','1')]}"/>

Rahul Nimgade
On 8/12/16, 7:43 AM

yes........exactly...like in product(menu) if we clicked on 'can be sold' then only 'sale'(page) is open

thank you...!

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/12/16, 2:12 AM
Seen: 165 times
Last updated: 8/12/16, 8:43 AM