From dd378dfdd6bc8c75960abfa3c19770e3c08fa09a Mon Sep 17 00:00:00 2001 From: Mario Arias Badila Date: Mon, 21 Oct 2024 12:06:25 -0600 Subject: [PATCH] [FIX] hr_expense_invoice: Proper partner If an expense report includes invoices from different providers, when posting move the report moves to "paid" and invoices are not reconciled as paid, as it fails to reconcile the lines with the transfer moves. Use the correct partner, from current expense line from the report, not always the same partner from first expense line. Fixes https://github.com/OCA/hr-expense/issues/273 --- hr_expense_invoice/models/hr_expense_sheet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hr_expense_invoice/models/hr_expense_sheet.py b/hr_expense_invoice/models/hr_expense_sheet.py index 6ab00809..dc191e68 100644 --- a/hr_expense_invoice/models/hr_expense_sheet.py +++ b/hr_expense_invoice/models/hr_expense_sheet.py @@ -36,8 +36,8 @@ def _do_create_moves(self): lambda x: x.display_type == "payment_term" ) transfer_line = move.line_ids.filtered( - lambda x: x.partner_id - == self.expense_line_ids.invoice_id.partner_id + lambda x, partner=expense.invoice_id.partner_id: + x.partner_id == partner ) (ap_lines + transfer_line).reconcile() return res