Skip to content
Snippets Groups Projects
Commit e1c36901 authored by Adrien Peiffer's avatar Adrien Peiffer
Browse files

[FIX] Use currency of analytic line


As the company is not mandatory on both the employee and the analytical account,
if neither is filled in, it causes the application to crash.

This commit ensures that the currency of the current analytical line's company
is provided when no company is set on the analytic account.

closes odoo/odoo#89849

Signed-off-by: default avatarLaurent Stukkens (ltu) <ltu@odoo.com>
parent d0da17b1
No related branches found
No related tags found
No related merge requests found
......@@ -183,7 +183,7 @@ class AccountAnalyticLine(models.Model):
cost = timesheet.employee_id.timesheet_cost or 0.0
amount = -timesheet.unit_amount * cost
amount_converted = timesheet.employee_id.currency_id._convert(
amount, timesheet.account_id.currency_id, self.env.company, timesheet.date)
amount, timesheet.account_id.currency_id or timesheet.currency_id, self.env.company, timesheet.date)
result[timesheet.id].update({
'amount': amount_converted,
})
......
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