[FIX] account: use datetime object

Unlike the name suggested, today is expected to be a datetime, not a date object

Fixes odoo/odoo#27445
This commit is contained in:
Martin Trigaux
2018-10-05 11:16:28 +02:00
parent 23bec7fb7f
commit 35151b62b3
@@ -91,7 +91,7 @@ class account_journal(models.Model):
@api.multi
def get_bar_graph_datas(self):
data = []
today = fields.Date.context_today(self)
today = fields.Datetime.now(self)
data.append({'label': _('Past'), 'value':0.0, 'type': 'past'})
day_of_week = int(format_datetime(today, 'e', locale=self._context.get('lang') or 'en_US'))
first_day_of_week = today + timedelta(days=-day_of_week+1)