[FIX] product: 'Nonetype object has no len()' error fixed in newly added constraints for decimal precision of 'Account' <= company's main currency rounding
bzr revid: qdp-launchpad@openerp.com-20120924111641-9papztx074vdbrpq
This commit is contained in:
parent
7b4e8cbbf8
commit
29badc35a5
|
@ -904,7 +904,7 @@ class res_currency(osv.osv):
|
||||||
def _check_main_currency_rounding(self, cr, uid, ids, context=None):
|
def _check_main_currency_rounding(self, cr, uid, ids, context=None):
|
||||||
cr.execute('SELECT digits FROM decimal_precision WHERE name like %s',('Account',))
|
cr.execute('SELECT digits FROM decimal_precision WHERE name like %s',('Account',))
|
||||||
digits = cr.fetchone()
|
digits = cr.fetchone()
|
||||||
if len(digits):
|
if digits and len(digits):
|
||||||
digits = digits[0]
|
digits = digits[0]
|
||||||
main_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id
|
main_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id
|
||||||
for currency_id in ids:
|
for currency_id in ids:
|
||||||
|
@ -923,7 +923,7 @@ class decimal_precision(osv.osv):
|
||||||
def _check_main_currency_rounding(self, cr, uid, ids, context=None):
|
def _check_main_currency_rounding(self, cr, uid, ids, context=None):
|
||||||
cr.execute('SELECT id, digits FROM decimal_precision WHERE name like %s',('Account',))
|
cr.execute('SELECT id, digits FROM decimal_precision WHERE name like %s',('Account',))
|
||||||
res = cr.fetchone()
|
res = cr.fetchone()
|
||||||
if len(res):
|
if res and len(res):
|
||||||
account_precision_id, digits = res
|
account_precision_id, digits = res
|
||||||
main_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id
|
main_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id
|
||||||
for decimal_precision in ids:
|
for decimal_precision in ids:
|
||||||
|
|
Loading…
Reference in New Issue