[FIX]:decimal_precision when precision is specified as 0

lp bug: https://launchpad.net/bugs/762960 fixed

bzr revid: nch@tinyerp.com-20110426124915-u1qykxakf9oyc35b
This commit is contained in:
Naresh (OpenERP) 2011-04-26 18:19:15 +05:30
parent 4dde776265
commit ca3c3fdbc9
1 changed files with 3 additions and 1 deletions

View File

@ -41,7 +41,9 @@ class decimal_precision(osv.osv):
def precision_get(self, cr, uid, application):
cr.execute('select digits from decimal_precision where name=%s', (application,))
res = cr.fetchone()
return res and res[0] or 2
if res:
return res[0]
return 2
def write(self, cr, uid, ids, data, *args, **argv):
res = super(decimal_precision, self).write(cr, uid, ids, data, *args, **argv)