[FIX] Compute should work when to_currency is not supplied
bzr revid: jvo@tinyerp.com-20100707121723-17fum9ubsr2470gq
This commit is contained in:
@@ -89,7 +89,9 @@ class res_currency(osv.osv):
|
||||
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}, account=None, account_invert=False):
|
||||
if not from_currency_id:
|
||||
from_currency_id = to_currency_id
|
||||
xc=self.browse(cr, uid, [from_currency_id,to_currency_id], context=context)
|
||||
if not to_currency_id:
|
||||
to_currency_id = from_currency_id
|
||||
xc = self.browse(cr, uid, [from_currency_id,to_currency_id], context=context)
|
||||
from_currency = (xc[0].id == from_currency_id and xc[0]) or xc[1]
|
||||
to_currency = (xc[0].id == to_currency_id and xc[0]) or xc[1]
|
||||
if from_currency['rate'] == 0 or to_currency['rate'] == 0:
|
||||
|
||||
Reference in New Issue
Block a user