تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6441 أدوات العرض

I have a field type datetime.

date=fields.Datetime('Request date',default=fields.Date.today, required=True,readonly=True,copy=True)

When I duplicate, the field date copy the date of created not the current date when I duplicate.

I want to duplicate the field with current date. Can I duplicate the date with the current date?


الصورة الرمزية
إهمال
أفضل إجابة

hello,

You may try like this(copy=False):

date=fields.Datetime('Request date',default=fields.Date.today, required=True,readonly=True,copy=False)

Hope this will help you.

الصورة الرمزية
إهمال
الكاتب

Hii Goood,very useful, thanks for your help

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يوليو 16
5869
8
مايو 23
61579
DateTime Python تم الحل
4
فبراير 23
71890
Datetime in Odoo تم الحل
2
يوليو 18
7095
2
فبراير 18
6977