From 6473e581465083642856630cb0864db7ece4bdd2 Mon Sep 17 00:00:00 2001 From: Quentin Groulard Date: Fri, 7 Feb 2020 15:46:48 +0100 Subject: [PATCH] [REF] Payment Returned on move line --- account_payment_return/models/account_move.py | 4 ++++ account_payment_return/models/payment_return.py | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/account_payment_return/models/account_move.py b/account_payment_return/models/account_move.py index 3f3aeecd2b28..408a28fe8776 100644 --- a/account_payment_return/models/account_move.py +++ b/account_payment_return/models/account_move.py @@ -24,3 +24,7 @@ class AccountMoveLine(models.Model): column1='move_line_id', column2='partial_reconcile_id', ) + + @api.multi + def _payment_returned(self, return_line): + self.mapped('invoice_id')._payment_returned(return_line) diff --git a/account_payment_return/models/payment_return.py b/account_payment_return/models/payment_return.py index 734eb6865272..b0848c9a22ed 100644 --- a/account_payment_return/models/payment_return.py +++ b/account_payment_return/models/payment_return.py @@ -227,9 +227,7 @@ def action_confirm(self): # returned_moves: debit on customer account (from invoice move) returned_moves = move_line.matched_debit_ids.mapped( 'debit_move_id') - returned_moves.mapped('invoice_id')._payment_returned( - return_line - ) + returned_moves._payment_returned(return_line) all_move_lines |= move_line move_line.remove_move_reconcile() (move_line | move_line2).reconcile()