Skip to Content
Menu
This question has been flagged
1 Reply
2738 Views

Is there any way to show the current date in form view without an access to opcode?

<field name="x_current_date"/> ---> it on display the label name of the field but it has a code inside in the compute field like...

for record in self:
record['x_current_date'] = datetime.now()


BUt it didnt work..


any help?


thanks in advance

Avatar
Discard
Best Answer

Hello,

Use 

datetime.datetime.now() for DateTime Field

datetime.date.today() for Date Field



Thanks & Regards

Avinash N K

Avatar
Discard