Hello wowas ,

I agree with tat when real server is not located in UTC Zone, 
there must be utcnow() instead of now().

Thanks.

** Changed in: openobject-server
   Importance: Undecided => Medium

** Changed in: openobject-server
       Status: Incomplete => Confirmed

** Changed in: openobject-server
     Assignee: (unassigned) => OpenERP's Framework R&D (openerp-dev-framework)

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1078200

Title:
  [Trunk,6.1] Timezone ERROR in Scheduled Actions

Status in OpenERP Server:
  Confirmed

Bug description:
  In module BASE in file "\base\ir\ir_cron.py" function _run_job don't
  work properly.

  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:
                      nextcall += 
_intervalTypes[job['interval_type']](job['interval_number'])

  that cause "nextcall" calculated N times
  (N=TimeZoneShift/interval_number) and it make wrong interval between
  run actions.

  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()

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1078200/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~openerp-india
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-india
More help   : https://help.launchpad.net/ListHelp

Reply via email to