Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6444 Lượt xem

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?


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả

Hii Goood,very useful, thanks for your help

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 16
5870
8
thg 5 23
61600
DateTime Python Đã xử lý
4
thg 2 23
71918
Datetime in Odoo Đã xử lý
2
thg 7 18
7096
2
thg 2 18
6982