Change to reflect new condition on move line: amount second currency is now always positive.

This commit is contained in:
Bertrand Chenal committed 2008-06-13 17:35:23 +02:00
1 parent dc885fee50
commit d31cb18212
1 file changed
+1 -1
+1 -1
View File
@@ -630,6 +630,7 @@ class Invoice(OSV):
res['amount_second_currency'] = currency_obj.compute(cursor, user,
invoice.company.currency, amount,
invoice.currency, context=context)
res['amount_second_currency'] = abs(res['amount_second_currency'])
res['second_currency'] = invoice.currency.id
else:
res['amount_second_currency'] = Decimal('0.0')
@@ -637,7 +638,6 @@ class Invoice(OSV):
if amount >= Decimal('0.0'):
res['debit'] = Decimal('0.0')
res['credit'] = amount
res['amount_second_currency'] = - res['amount_second_currency']
else:
res['debit'] = - amount
res['credit'] = Decimal('0.0')