diff options
| author | Toufik Benjaa <tbe@odoo.com> | 2018-05-17 10:33:12 +0200 |
|---|---|---|
| committer | Toufik Benjaa <tbe@odoo.com> | 2018-05-17 12:05:44 +0200 |
| commit | fc3177af9eb9355f41955b581149a80c22b8b2b0 (patch) | |
| tree | 60bdbd3185fcf7e6e4b9f6204e427c4aab0e1d32 /addons | |
| parent | 59a04f151083be086fe60ad5c6529097f4ad0933 (diff) | |
[FIX] hr_timesheet: Use analytic account company on timesheet line
- When creating an analytic line for a timesheet that uses a project linked with an analytic account, we copy the company_id of the account to the line.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/hr_timesheet/models/hr_timesheet.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/hr_timesheet/models/hr_timesheet.py b/addons/hr_timesheet/models/hr_timesheet.py index fa2ce2b944b..9555d9f5c10 100644 --- a/addons/hr_timesheet/models/hr_timesheet.py +++ b/addons/hr_timesheet/models/hr_timesheet.py @@ -65,6 +65,7 @@ class AccountAnalyticLine(models.Model): if vals.get('project_id') and not vals.get('account_id'): project = self.env['project.project'].browse(vals.get('project_id')) vals['account_id'] = project.analytic_account_id.id + vals['company_id'] = project.analytic_account_id.company_id.id # employee implies user if vals.get('employee_id') and not vals.get('user_id'): employee = self.env['hr.employee'].browse(vals['employee_id']) |
