From bcbabbc61fa4ae02a234fe72bafe06805c6193b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 7 Jul 2008 22:33:58 +0200 Subject: [PATCH] Fix default values in ir.cron for issue175 --- trytond/ir/cron.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trytond/ir/cron.py b/trytond/ir/cron.py index 9914c8bfa1..abaf2d363b 100644 --- a/trytond/ir/cron.py +++ b/trytond/ir/cron.py @@ -8,10 +8,10 @@ SPEC: Execute "model.function(*eval(args))" periodically """ from mx import DateTime -import time from trytond import pooler from trytond.osv import fields, OSV from trytond.netsvc import Agent +import datetime _INTERVALTYPES = { 'work_days': lambda interval: DateTime.RelativeDateTime(days=interval), @@ -51,7 +51,7 @@ class Cron(OSV, Agent): help='0=Very Urgent\n10=Not urgent') def default_nextcall(self, cursor, user, context=None): - return time.strftime('%Y-%m-%d %H:%M:%S') + return datetime.datetime.now() def default_priority(self, cursor, user, context=None): return 5 @@ -69,10 +69,10 @@ class Cron(OSV, Agent): return 1 def default_active(self, cursor, user, context=None): - return 1 + return True def default_doall(self, cursor, user, context=None): - return 1 + return True def _callback(self, cursor, user, model, func, args): args = (args or []) and eval(args)