Skip to content

Commit

Permalink
[FIX] hr_expense_invoice: Proper partner
Browse files Browse the repository at this point in the history
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 #273
  • Loading branch information
TheCloneMaster authored Oct 21, 2024
1 parent 598eb41 commit dd378df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hr_expense_invoice/models/hr_expense_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd378df

Please sign in to comment.