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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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,
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký