I am trying to make the default value for a checkbox "FALSE". When i type in false for the default value and try to create a new contact, the box is still checked and should not be. If there is anyone that can help me with this, it would be much appreciated.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
HI,
Always the default value of the check box will be false. You are getting it as ticked/True due to logical error that you had given in the default. To get default as False, just define the field like this,
field_name = fields.Boolean(string="check box")
Anyway if you want to assign False using default you can try like this,
field_name = fields.Boolean(string="check box", default=False)
Hi Niyas, when you create a field from odoo's interface, is there a way to set default value from field?
Like this: https://ibb.co/CPm3BJQ
I have currently created some fields directly in Odoo and not from .py files, and hope to be able to change it to .py files soon, but at the moment I wish to create them with default values hopefully and not change context in action due to some updates means this change is lost and updated to default context from .py file of native modules (Using odoo Enterprise)
Hope it's understandable.
Thanks!
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar