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:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
1
الرد
6564
أدوات العرض
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,
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل