Priyan Changd
Priyan Changd

Reputation: 169

Openerp 7 Checkbox

I need to add check box in openerp form.and when check that box, then need to appear text box below.text box need to show only after that box checked.

how to do this requirement in openerp (ver 7) ?

fox ex :

[x] eliglible for EPF

EPF Number : [________]

Upvotes: 1

Views: 1264

Answers (1)

Ethan Furman
Ethan Furman

Reputation: 69288

Is the entire form custom, or are you inheriting from an existing form? Either way, you want to add a couple fields to the table (in the .py file):

'epf_eligible': fields.boolean("eligible for EPF"),
'epf_number': fields.integer("EPF Number", size=10),

Then you'll need to have the display logic be in the ..._view.xml file, and it will look something like this:

<field name="epf_eligible"/>
<field name="epf_number" attrs="{'invisible':[('epf_eligible','=',False)]}"/>

Now, EPF Number will only show up when eligible for EPF is True.

Upvotes: 2

Related Questions