odoo/odoo — pull request #1744 by feketemihai (2014-08-12 08:45:50+00:00)
Title: Fix ir.cron astimezone cannot be applied to a naive datetime error when ...

Fix ir.cron astimezone cannot be applied to a naive datetime error whenwriting nextcall.

Impacted Versions:

* 7.0 and above

Stept to reproduce:

When writing to postgresql th enextcall value, in log appears error:

Traceback (most recent call last):
File "/home/openerp/openerp/l10n_ro_odoo/openerp/addons/base/ir/ir_cron.py", line 251, in _acquire_job
registry[cls._name]._process_job(job_cr, job, lock_cr)
File "/home/openerp/openerp/l10n_ro_odoo/openerp/addons/base/ir/ir_cron.py", line 180, in _process_job
(nextcall.astimezone(pytz.UTC).strftime(DEFAULT_SERVER_DATETIME_FORMAT), numbercall, job['id']))
ValueError: astimezone() cannot be applied to a naive datetime
2014-08-12 08:03:45,235 46099 ERROR odoo openerp.addons.base.ir.ir_cron: Unexpected exception while processing cron job {'function': u'_check', 'create_uid': 1, 'args': u'(True,)', 'user_id': 1, 'name': u'Check Action Rules', 'interval_type': u'hours', 'numbercall': -1, 'nextcall': '2014-08-12 07:44:38', 'priority': 5, 'model': u'base.action.rule', 'doall': False, 'write_date': '2014-08-07 11:44:38.553547', 'active': True, 'create_date': '2014-08-07 11:44:38.553547', 'interval_number': 4, 'write_uid': 1, 'id': 7}