Skip to content
Snippets Groups Projects
Commit 0b83dd9a authored by Yannick Tivisse's avatar Yannick Tivisse
Browse files

[FIX] sale_timesheet: Set the account_id on the analytic entries from timesheets

When we create a timesheet activity, it create an analytic line that allows to re-invoice the costs from the employee. If the account_id is not set on the analytic account line, the employee cost is not passed correctly on the Analytic Entries, which is not the behavior we should expect.

This commit simply adds a account_id on the employee and this account is returned with the cost and the uom by the method `_get_timesheet_cost`
parent 6fc692d3
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,8 @@ class AccountAnalyticLine(models.Model):
# Nominal employee cost = 1 * company project UoM (project_time_mode_id)
return {
'amount': -unit_amount * cost,
'product_uom_id': uom.id
'product_uom_id': uom.id,
'account_id': emp.account_id,
}
return {}
......
......@@ -9,3 +9,4 @@ class HrEmployee(models.Model):
# FIXME: this field should be in module hr_timesheet, not sale_timesheet
timesheet_cost = fields.Float('Timesheet Cost', default=0.0)
account_id = fields.Many2one('account.account', string='Account')
......@@ -8,6 +8,7 @@
<xpath expr="//group[@name='active_group']" position="before">
<group string="Timesheets">
<field name="timesheet_cost"/>
<field name="account_id"/>
</group>
</xpath>
</field>
......
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