diff --git a/bin/addons/base/res/res_currency.py b/bin/addons/base/res/res_currency.py index 41b8de2f75e..5c9911022eb 100644 --- a/bin/addons/base/res/res_currency.py +++ b/bin/addons/base/res/res_currency.py @@ -82,7 +82,14 @@ class res_currency(osv.osv): 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: - raise osv.except_osv('Error', 'No rate found for the currency') + date = context.get('date', time.strftime('%Y-%m-%d')) + if from_currency['rate'] == 0: + code = from_currency.code + else: + code = to_currency.code + raise osv.except_osv('Error', 'No rate found \n' \ + 'for the currency: %s \n' \ + 'at the date: %s' % (code, date)) if to_currency_id==from_currency_id: if round: return self.round(cr, uid, to_currency, from_amount)