Skip to Content
Menu
This question has been flagged
2 Replies
2452 Views

reg_date = fields.Date(string='Registration Date', default=datetime.today(), track_visibility='onchange')


When i created a records on today the date i get must be today right ?


but what i get now is yesterday date, i don't know what happen so i tried to kill python on the server then i try again to create a record and i get a right date. but tommorrow i get a wrong date again.


and i try to kill python again, and it's works. but i can't do it every single day so did anyone here ever face a problem like this?

for example : 28 Feb 2020 i create a record but on the record show 27 Feb 2020 then i kill the python and start the server again, when i create the record the date was right 28 Feb 2020.

i been try this 3 times in different time. 8a.m, 11a.m, 2p.m

Best Regards,
Chaanto   


Avatar
Discard

Hi,

Just try like this

reg_date= fields.Datetime("Registration date", default=fields.Datetime.now())

or

reg_date = fields.Date("Registration date",default=fields.Date.today())

Best Answer

Hi,

please see this app, if helpful

https://www.odoo.com/apps/modules/11.0/user_wise_datetime_format/

Avatar
Discard