From 4a7ee23e2c35813f30df5f18df0378ce9aaea87f Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Thu, 29 Sep 2022 21:10:15 +0200 Subject: [PATCH] splitline: parameter fix --- splitline.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/splitline.py b/splitline.py index a3831c2..649c5f3 100644 --- a/splitline.py +++ b/splitline.py @@ -106,14 +106,14 @@ class SplitLine(ModelSQL, ModelView): 'type': gettext('cashbook.msg_line_bookingtype_%s' % self.line.bookingtype), } - def get_amount_by_second_currency(self, to_currency): + def get_amount_by_second_currency(self, to_currency, amount=None): """ get amount, calculate credit/debit from currency of current cashbook to 'to_currency' """ Currency = Pool().get('currency.currency') values = { - 'amount': self.amount, + 'amount': amount if amount is not None else self.amount, } if to_currency.id != self.line.cashbook.currency.id: @@ -122,7 +122,7 @@ class SplitLine(ModelSQL, ModelView): }): values['amount'] = Currency.compute( self.line.cashbook.currency, - self.amount, + values['amount'], to_currency) return values