[FIX] sale_timesheet: link timesheet line to product
Commit fde3a529 unlinks the product and the timesheet. Although we don't
want to use the cost of the product in the timesheet, we still want to
link the timesheet to the product for reporting.
This commit is contained in:
@@ -56,7 +56,10 @@ class AccountAnalyticLine(models.Model):
|
||||
('product_id.type', '=', 'service')],
|
||||
limit=1)
|
||||
if sol:
|
||||
result['so_line'] = sol.id
|
||||
result.update({
|
||||
'so_line': sol.id,
|
||||
'product_id': sol.product_id.id,
|
||||
})
|
||||
result = self._get_timesheet_cost(result)
|
||||
|
||||
result = super(AccountAnalyticLine, self)._get_sale_order_line(vals=result)
|
||||
@@ -75,7 +78,7 @@ class AccountAnalyticLine(models.Model):
|
||||
uom = (emp or user).company_id.project_time_mode_id
|
||||
# Nominal employee cost = 1 * company project UoM (project_time_mode_id)
|
||||
result.update(
|
||||
amount=(-unit_amount * emp.timesheet_cost),
|
||||
amount=(-unit_amount * cost),
|
||||
product_uom_id=uom.id
|
||||
)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user