Odoo Help


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.


Don't show a form when i check a chekbox

Coralie Cardon
on 2/2/16, 3:38 AM 506 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
--Atul Arvind--


I am odoo Enthusiast/Consultant from Baroda, Gujarat, India. Working with odoo from v5 to v9 and other opensource technology since 4+ years. Having Strong Expertise in

Requirement gathering & Gap Analysis

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration


I am also active on StackOverflow.


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--
| 6 4 8
Surat, India
--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

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)


Asked: 2/2/16, 3:38 AM
Seen: 506 times
Last updated: 2/2/16, 6:37 AM