From f57d917e5a24f67f25e600c7bb22e2ba82cca20d Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Fri, 18 Jul 2014 18:31:33 -0400 Subject: [PATCH] currency_rate_update : mini date fix in currency_rate_update.py --- currency_rate_update/currency_rate_update.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/currency_rate_update/currency_rate_update.py b/currency_rate_update/currency_rate_update.py index c670abbd5..94492137c 100644 --- a/currency_rate_update/currency_rate_update.py +++ b/currency_rate_update/currency_rate_update.py @@ -247,12 +247,12 @@ class Currency_rate_update(osv.Model): # Show the most recent note at the top msg = "%s \n%s currency updated. %s" % \ (log_info or '', - datetime.strftime(datetime.today(), DEFAULT_SERVER_DATETIME_FORMAT), + datetime.today().strftime(DEFAULT_SERVER_DATETIME_FORMAT), note) service.write({'note': msg}) except Exception as exc: error_msg = "\n%s ERROR : %s %s" %\ - (datetime.strftime(datetime.today(), DEFAULT_SERVER_DATETIME_FORMAT), + (datetime.today().strftime(DEFAULT_SERVER_DATETIME_FORMAT), repr(exc), note) _logger.info(repr(exc)) @@ -401,7 +401,7 @@ class Curreny_getter_interface(object): # We always have a warning when rate_date != today rate_date_str = datetime.strftime(rate_date, DEFAULT_SERVER_DATE_FORMAT) - if rate_date_str != datetime.strftime(datetime.today(), DEFAULT_SERVER_DATE_FORMAT): + if rate_date.date() != datetime.today().date(): msg = "The rate timestamp (%s) is not today's date" self.log_info = ("WARNING : %s %s") % (msg, rate_date_str) _logger.warning(msg, rate_date_str)