[Trunk,6.1] Timezone ERROR in Scheduled Actions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Medium
|
OpenERP's Framework R&D |
Bug Description
In module BASE in file "\base\
It take parametr "now" that calculated in local timezone like:
now = datetime.now()
and then compared in loop with "numbercall" that take from DB in UTC:
while nextcall < now and numbercall:
...
if numbercall:
that cause "nextcall" calculated N times (N=TimeZoneShif
For example:
=======
current time = 09:00 (UTC)
local current time = 13:00 (TZ = UTC+4) (current time of server)
interval_number = 1 (from DB)
interval_type = minutes (from DB)
nextcall = 09:00 (from DB)
Time to run scheduled action, that cause run function _run_job that calculate new "nextcall":
nextcall = 09:00 + 00:01 (and repeat it 240 times)
nextcall = 13:01
So next run scheduled action will at 13:01 (UTC) or 17:01(local TZ). We have interval 4h and 1min, bat expect interval 1min!!!
=======
For correct work need
now = datetime.now()
change on
now = datetime.utcnow()
The change described works.