Skip to content
Snippets Groups Projects
Commit 73f7a2ba authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] project_timesheet: date of created analytic line not in user tz

When the user was in timezone UTC + 1, and added a project.task.work which created an analytic entry line (timsheet activity), if the datetime was set to 11/25 00:00:00, the date on the analytic line was set to 11/24, because this was the truncated stored value(UTC Time), which was 11/24 23:00:00
parent 4ce7af35
No related branches found
No related tags found
No related merge requests found
......@@ -120,7 +120,9 @@ class project_work(osv.osv):
vals_line['user_id'] = vals['user_id']
vals_line['product_id'] = result['product_id']
if vals.get('date'):
vals_line['date' ] = vals['date'][:10]
timestamp = datetime.datetime.strptime(vals['date'], tools.DEFAULT_SERVER_DATETIME_FORMAT)
ts = fields.datetime.context_timestamp(cr, uid, timestamp, context)
vals_line['date'] = ts.strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
# Calculate quantity based on employee's product's uom
vals_line['unit_amount'] = vals['hours']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment