[FIX] sale_timesheet: _get_timesheet_cost
A user must be set to get the right timesheet_cost opw:684036
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user