Those anyone know how to define a default value in a field?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Hello Jesus Aldana,
You can use default keyword while filed declaration to define default value.
For Ex:-
Here Some default value example for different type of field.
date = fields.Date('Date', default=lambda self: fields.datetime.now()) #Date Field
name = fields.Char('Name', default='New') #Char Field
type_selection = fields.Boolean('Type', default=True) #Boolean Field
Hope it will helps you.
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