This question has been flagged
4 Replies
3710 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....!

Avatar
Discard

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

Best Answer

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

Avatar
Discard
Best Answer

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

Avatar
Discard
Author Best Answer

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

thank you...!

Avatar
Discard