From a5fdace88018e1ab91a41bf061b7d57e41365653 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Fri, 2 Aug 2024 12:09:06 -0300 Subject: [PATCH] [FIX] hr_expense_advance_clearing: fetch the product considering the company so that the correct property can be retrieved --- hr_expense_advance_clearing/models/hr_expense_sheet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hr_expense_advance_clearing/models/hr_expense_sheet.py b/hr_expense_advance_clearing/models/hr_expense_sheet.py index 9f760849..ce3faa08 100644 --- a/hr_expense_advance_clearing/models/hr_expense_sheet.py +++ b/hr_expense_advance_clearing/models/hr_expense_sheet.py @@ -88,8 +88,11 @@ def _compute_clearing_residual(self): emp_advance = sheet._get_product_advance() residual_company = 0.0 if emp_advance: + property_account_expense_id = emp_advance.with_company( + sheet.company_id + ).property_account_expense_id for line in sheet.sudo().account_move_id.line_ids: - if line.account_id == emp_advance.property_account_expense_id: + if line.account_id == property_account_expense_id: residual_company += line.amount_residual sheet.clearing_residual = residual_company