Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6429 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 16
5865
[Solved] Date/ Time in Odoo with python แก้ไขแล้ว
8
พ.ค. 23
61565
DateTime Python แก้ไขแล้ว
4
ก.พ. 23
71880
Datetime in Odoo แก้ไขแล้ว
2
ก.ค. 18
7095
2
ก.พ. 18
6968