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
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
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,
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się