Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Real Estate
    • Real Estate Agency
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consulting
    • Accounting Firm
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Solar Energy Systems
    • Shoe Maker
    • Serveis de neteja
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Don't show a form when i check a chekbox

Subscriure's

Get notified when there's activity on this post

This question has been flagged
formcheckbox
2 Respostes
7411 Vistes
Avatar
Coralie Cardon

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 ! 

0
Avatar
Descartar
Avatar
Atul Makwana
Best Answer

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'/>
</group>

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

2
Avatar
Descartar
Avatar
Jignesh Mehta
Best Answer

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">

        <form>

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

                    <field name="field1"/>

                     <field name="field2"/>

              </group>

         </form>

     </field>

</record>


Hope, it will help you.

Thanks,

0
Avatar
Descartar
Atul Makwana

how?

Coralie Cardon
Autor

Hello, I have an error :( Uncaught Error: Unknown field check_box_form in domain [["check_box_form","=",true]] http://10.56.8.44:8069/web/static/src/js/framework/data.js:1075 Traceback: Error: Unknown field check_box_form in domain [["check_box_form","=",true]] at Object.compute_domain (http://10.56.8.44:8069/web/static/src/js/framework/data.js:1075:19) at OdooClass.View.extend.compute_domain (http://10.56.8.44:8069/web/static/src/js/views/form_view.js:1151:21) at OdooClass. (http://10.56.8.44:8069/web/static/src/js/views/form_common.js:316:40) at OdooClass.Class.extend.trigger (http://10.56.8.44:8069/web/static/src/js/framework/mixins.js:222:31) at OdooClass._.extend.trigger (http://10.56.8.44:8069/web/static/src/js/framework/mixins.js:272:42) at OdooClass.View.extend.on_form_changed (http://10.56.8.44:8069/web/static/src/js/views/form_view.js:396:14) at Array. (http://10.56.8.44:8069/web/static/src/js/views/form_view.js:365:18) at Array. (http://10.56.8.44:8069/web/static/lib/jquery/jquery.js:3276:89) at fire (http://10.56.8.44:8069/web/static/lib/jquery/jquery.js:3119:58) at Object.self.add [as done] (http://10.56.8.44:8069/web/static/lib/jquery/jquery.js:3165:49)

Jignesh Mehta

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

Coralie Cardon
Autor

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 ?

Jignesh Mehta

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

Coralie Cardon
Autor

ok but if the form is like that :

if i put the attributes in the groupes the footer is visible
Coralie Cardon
Autor
Coralie Cardon
Autor

form - group - footer - /form *

Jignesh Mehta

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

Coralie Cardon
Autor

I have the same error :(

Jignesh Mehta

can you post your code with the error msg ?

Atul Makwana

check_box_form field should be in your form view.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Can i create multiple forms for a single model using studio ? Solved
form
Avatar
Avatar
2
de set. 25
1125
odoo 17 checkbox field length before line break
form checkbox OdooStudio worksheets
Avatar
Avatar
Avatar
2
de maig 24
2533
GDPR checkbox for landing page Solved
checkbox
Avatar
Avatar
2
de des. 23
2119
XML: make checkbox label greyed out when False
xml form checkbox v14
Avatar
Avatar
1
de nov. 22
3414
How to make Odoo form readonly when the record has an specific state?
form
Avatar
0
de gen. 21
3161
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now