From 9963b795e8b0acac4dd073b40850f8960e45b4b4 Mon Sep 17 00:00:00 2001 From: SilvioC2C Date: Wed, 27 Nov 2024 13:21:35 +0100 Subject: [PATCH] [FIX] account_payment_order: fix ``TypeError`` Method ``_get_reconciled_invoices_partials()`` returns 2 lists: - the first one contains triplets defined as (account.partial.reconcile record, amount, account.move.line record) - the second one contains account.move IDs Merging the 2 lists and cycling over them with ``` for (_x, _y, payment_move_line) in list1 + list2: ... ``` resulted in ``TypeError: cannot unpack non-iterable int object``. This commit fixes this bug. --- account_payment_order/models/account_move.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/account_payment_order/models/account_move.py b/account_payment_order/models/account_move.py index 5882aa85d29..9defc09f26f 100644 --- a/account_payment_order/models/account_move.py +++ b/account_payment_order/models/account_move.py @@ -78,19 +78,17 @@ def _get_payment_order_communication_full(self): reference_moves |= self.reversal_move_id # Retrieve partial payments - e.g.: manual credit notes ( + # List of triplets + # (account.partial.reconcile record, amount, account.move.line record) invoice_partials, - exchange_diff_moves, + # List of account.move IDs + exchange_diff_move_ids, ) = self._get_reconciled_invoices_partials() - for ( - _x, - _y, - payment_move_line, - ) in invoice_partials + exchange_diff_moves: - payment_move = payment_move_line.move_id - if payment_move not in reference_moves: - references.append( - payment_move._get_payment_order_communication_direct() - ) + move_ids = [x[2].move_id.id for x in invoice_partials] + exchange_diff_move_ids + for move in self.browse(move_ids): + if move not in reference_moves: + references.append(move._get_payment_order_communication_direct()) + reference_moves |= move # Add references to communication from lines move if references: communication += " " + " ".join(references)