[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.
This commit is contained in:
Stéphane Bidoul (ACSONE)
2016-07-19 13:56:36 +02:00
committed by GitHub
parent 4bf8989f18
commit 64773e32bc

View File

@@ -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