[FIX] sale_timesheet: _get_timesheet_cost

A user must be set to get the right timesheet_cost

opw:684036
This commit is contained in:
Goffin Simon
2016-07-27 15:54:51 +02:00
parent 2cf80e0075
commit 138cf9bbce
@@ -73,7 +73,7 @@ class AccountAnalyticLine(models.Model):
if result.get('amount'):
return result
unit_amount = result.get('unit_amount', 0.0) or self.unit_amount
user_id = result.get('user_id') or self.user_id.id
user_id = result.get('user_id') or self.user_id.id or self._default_user()
user = self.env['res.users'].browse([user_id])
emp = self.env['hr.employee'].search([('user_id', '=', user_id)], limit=1)
cost = emp and emp.timesheet_cost or 0.0