splitline: parameter fix

This commit is contained in:
Frederik Jaeckel 2022-09-29 21:10:15 +02:00
parent b6799e355f
commit 4a7ee23e2c

View file

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