[IMP] improve warning message
bzr revid: bde@tinyerp.com-20131202084244-oc0gs75vwix3wgv3
This commit is contained in:
parent
56bb1b9869
commit
77fa521db5
|
@ -49,6 +49,7 @@ class res_currency(osv.osv):
|
|||
currency_rate_type = context.get('currency_rate_type_id') or None
|
||||
# ... and use 'is NULL' instead of '= some-id'.
|
||||
operator = '=' if currency_rate_type else 'is'
|
||||
currency_name = self.browse(cr, uid, ids, context=context)[0].name
|
||||
for id in ids:
|
||||
cr.execute("SELECT currency_id, rate FROM res_currency_rate WHERE currency_id = %s AND name <= %s AND currency_rate_type_id " + operator +" %s ORDER BY name desc LIMIT 1" ,(id, date, currency_rate_type))
|
||||
if cr.rowcount:
|
||||
|
@ -57,7 +58,7 @@ class res_currency(osv.osv):
|
|||
elif not raise_on_no_rate:
|
||||
res[id] = 0
|
||||
else:
|
||||
raise osv.except_osv(_('Error!'),_("No currency rate associated for currency %d for the given period" % (id)))
|
||||
raise osv.except_osv(_('Error!'),_("No currency rate associated for currency %d for the given period" % (currency_name)))
|
||||
return res
|
||||
|
||||
_name = "res.currency"
|
||||
|
|
Loading…
Reference in New Issue