summaryrefslogtreecommitdiff
path: root/addons/hr_expense
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2018-08-17 01:49:22 +0200
committerMartin Trigaux <mat@odoo.com>2018-08-17 13:46:39 +0200
commitd97e69ff0241af7403eef4a01f4dcf3f4e06963e (patch)
treebfa1b88083f512a791674cd80295f7ecf45ebe22 /addons/hr_expense
parentc51cfbc58b826fdaa9ccda17b4a0dc1759ed06f5 (diff)
[FIX] mail: schedule activity with user's today
The activity was incorrectly scheduled with a deadline as the now in UTC while the state was computed using "today" in the user's timezone. This made the nightly test fail (run at 23:30 UTC with the user in UTC+2). Use context_today instead of today for all activity_schedule calls To make it easier, use on the context_today default value instead of setting context_today everywhere (which is more error prone in the future) Never use datetime, only date objects add a warning to detect potential errors when passing a datetime Closes #26411
Diffstat (limited to 'addons/hr_expense')
-rw-r--r--addons/hr_expense/models/hr_expense.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py
index a3eeae84146..cd5a123c691 100644
--- a/addons/hr_expense/models/hr_expense.py
+++ b/addons/hr_expense/models/hr_expense.py
@@ -721,7 +721,7 @@ class HrExpenseSheet(models.Model):
def activity_update(self):
for expense_report in self.filtered(lambda hol: hol.state == 'submit'):
self.activity_schedule(
- 'hr_expense.mail_act_expense_approval', fields.Date.today(),
+ 'hr_expense.mail_act_expense_approval',
user_id=expense_report._get_responsible_for_approval().id)
self.filtered(lambda hol: hol.state == 'approve').activity_feedback(['hr_expense.mail_act_expense_approval'])
self.filtered(lambda hol: hol.state == 'cancel').activity_unlink(['hr_expense.mail_act_expense_approval'])