[FIX] gamification: use context_today instead of today

`fields.Date.today` doesn't give date based on TZ which might be wrong
in some cases as it doesn't respect TZ.

With this commit, we are using `fields.Date.context_today` as default date.

closes odoo/odoo#76241

X-original-commit: addd4ae73ca4fa7a7046a88dd1310361dd895f15
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Swapnesh Shah
2021-09-10 12:33:49 +00:00
committed by GitHub
parent 2dc7b1a3b2
commit 655a863d6e
+1 -1
View File
@@ -412,7 +412,7 @@ class Goal(models.Model):
If the current value is changed and the report frequency is set to On
change, a report is generated
"""
vals['last_update'] = fields.Date.today()
vals['last_update'] = fields.Date.context_today(self)
result = super(Goal, self).write(vals)
for goal in self:
if goal.state != "draft" and ('definition_id' in vals or 'user_id' in vals):