Skip to content
Snippets Groups Projects
Commit 67901a44 authored by Julien Alardot (jual)'s avatar Julien Alardot (jual)
Browse files

[FIX] hr_expense: recompute expense currency


Fix a corner case when the expense currency doesn't update when a cost is added to the product

Steps to reproduce:
- Create an expense in a foreign currency
- Add a cost to the expense product

Before fix:
Unit amount currency stays in foreign currency

After fix:
Forces expense currency to
 company currency

task-3455446

closes odoo/odoo#131043

Signed-off-by: default avatarLaurent Smet (las) <las@odoo.com>
parent 57f71fa2
No related branches found
No related tags found
No related merge requests found
......@@ -142,7 +142,7 @@ class HrExpense(models.Model):
for expense in self:
expense.same_currency = bool(not expense.company_id or (expense.currency_id and expense.currency_id == expense.company_currency_id))
@api.depends('product_id')
@api.depends('product_id.standard_price')
def _compute_product_has_cost(self):
for expense in self:
expense.product_has_cost = expense.product_id and (float_compare(expense.product_id.standard_price, 0.0, precision_digits=2) != 0)
......
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