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

Hi,

I understand that Odoo use utc for all the time in the database.  It use user timezone to show the local time to the user.  But how is it possible to set the day to start on localtime and not utc.

Actualy when we close late, it happen that the report of today sales  show a few late night order from yesterday as the day is starting @ 20:00 instead of midnight (utc-4).  Thank you for you answer.

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

Faced the same issue with date field and found a Solution..!!

import pytz

from pytz import timezone


Date=fields.Date(string='Appointment Date',default =  lambda self:

datetime.now(pytz.timezone('Asia/Phnom_Penh')).date())


Add your timezone instead of  ('Asia/Phnom_Penh')

Hope this Help You !!
:)



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

Hi Benoît / Bonjour Benoît,

Did you find any solution to this problem?

Thanks!

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

Well, still no luck, still facing that issue.  Anybody have comment or idea, except changing the localtime

Ảnh đại diện
Huỷ bỏ