Odoo Help


Don't show a form when i check a chekbox

Coralie Cardon
on 2/2/16, 3:38 AM 1,211 views

Hello !

I have a form, and when i have checked my checkbok i would like odoo don't show this form. 

How can i do ? 

What is the codee to use ? 

Thanks ! 


Atul Arvind

--Atul Arvind--
| 3 3 5
vadodara, India
--Atul Arvind--


I am odoo Enthusiast/Developer from Vadodara, India. Working with odoo from v5 to v11 and other opensource technology since 5+ years. Having Strong Expertise in

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration


Here is my StackOverflow profile.  you can also find me on LinkedIn.

Contact: atul.surficle@gmail.com.

Atul Arvind
On 2/2/16, 6:37 AM

you can use the attrs in XML in order to make fields, group, notebook, page invisible, read-only & required. Here is a piece of code that might help you.

  <field name="checkbox_field" string='Make Group Invisible?'  />
  <group name="my group" attrs="{'invisible' : [('checkbox_field', '=', True)]}">
<field name='field1'/>
<field name='field2'/>

when you check the check box it will make the whole group invisible.

--Jignesh Mehta--

Jignesh Mehta
On 2/2/16, 6:13 AM

Hello Coco,

For don't show a form when click, you need to add attrs to the form view.

For Ex:-

<record id="unique_id" model="ir.ui.view">

    <field name="name">name</field>

    <field name="model">model_name</field>

    <field name="arch" type="xml">


              <group name="field_group" attrs="{'invisible' : [('your_checkbox_name', '=', True)]}">

                    <field name="field1"/>

                     <field name="field2"/>





Hope, it will help you.



Atul Arvind
on 2/2/16, 6:39 AM

Hello, I have an error :( Uncaught Error: Unknown field check_box_form in domain [["check_box_form","=",true]] Traceback: Error: Unknown field check_box_form in domain [["check_box_form","=",true]] at Object.compute_domain ( at OdooClass.View.extend.compute_domain ( at OdooClass. ( at OdooClass.Class.extend.trigger ( at OdooClass._.extend.trigger ( at OdooClass.View.extend.on_form_changed ( at Array. ( at Array. ( at fire ( at Object.self.add [as done] (

BHC SPRL, Coralie Cardon
on 2/2/16, 7:28 AM

have you add your field in form view as say by Atul Arvind sir ?

Jignesh Mehta
on 2/2/16, 7:38 AM

Yes i had add the attributes in the form. But the problem is : when i click on my module i have my form like a pop up. In the configuration of the module you add this check box. The check box isn't in the form. Do you see what i mean ?

BHC SPRL, Coralie Cardon
on 2/2/16, 7:42 AM

Form can't be hide through attrs. You can invisible, readonly and required to notebook, page, fields, groups.

Jignesh Mehta
on 2/2/16, 7:45 AM

ok but if the form is like that :

if i put the attributes in the groupes the footer is visible
BHC SPRL, Coralie Cardon
on 2/2/16, 7:49 AM
BHC SPRL, Coralie Cardon
on 2/2/16, 7:51 AM

form - group - footer - /form *

BHC SPRL, Coralie Cardon
on 2/2/16, 7:52 AM

May be, you can also add attrs in the footer to invisible it.

Jignesh Mehta
on 2/2/16, 7:58 AM

I have the same error :(

BHC SPRL, Coralie Cardon
on 2/2/16, 8:08 AM

can you post your code with the error msg ?

Jignesh Mehta
on 2/2/16, 8:32 AM

check_box_form field should be in your form view.

Atul Arvind
on 2/2/16, 11:08 AM

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: 2/2/16, 3:38 AM
Seen: 1211 times
Last updated: 2/2/16, 6:37 AM