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

how to trigger Boolean field to show new form

By
Rahul Nimgade
on 8/12/16, 2:12 AM 141 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
1
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.

Likewise,

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)]}">

0
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')]}"/>

0
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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