From 3dca43bcc17af106c1a6598438a72f93e7c5b940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Tue, 19 Jul 2016 13:56:36 +0200 Subject: [PATCH] [IMP] account_payment_order: extensibility of _prepare_move Pass the list of bank lines to _prepare_move so it is possible to customize the move (eg it's name) based on the lines being paid. --- account_payment_order/models/account_payment_order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_payment_order/models/account_payment_order.py b/account_payment_order/models/account_payment_order.py index e1d95f68d..dd0dce252 100644 --- a/account_payment_order/models/account_payment_order.py +++ b/account_payment_order/models/account_payment_order.py @@ -330,7 +330,7 @@ class AccountPaymentOrder(models.Model): return True @api.multi - def _prepare_move(self): + def _prepare_move(self, bank_lines=None): if self.payment_type == 'outbound': ref = _('Payment order %s') % self.name else: @@ -433,7 +433,7 @@ class AccountPaymentOrder(models.Model): trfmoves[hashcode] = bline for hashcode, blines in trfmoves.iteritems(): - mvals = self._prepare_move() + mvals = self._prepare_move(blines) total_company_currency = total_payment_currency = 0 for bline in blines: total_company_currency += bline.amount_company_currency