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
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
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!
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up