splitline: parameter fix
This commit is contained in:
parent
b6799e355f
commit
4a7ee23e2c
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue