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
1
Reply
5394
Views
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,