[IMP] analytic: do clean type check with isinstance
bzr revid: rco@openerp.com-20120508141305-m96be66gtw1lztik
This commit is contained in:
parent
abdc6e0383
commit
e9d359a7ed
|
@ -96,7 +96,7 @@ class account_analytic_account(osv.osv):
|
|||
return self._compute_level_tree(cr, uid, ids, child_ids, res, fields, context)
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if type(ids) != type([]):
|
||||
if isinstance(ids, (int, long)):
|
||||
ids=[ids]
|
||||
if not ids:
|
||||
return []
|
||||
|
@ -134,7 +134,7 @@ class account_analytic_account(osv.osv):
|
|||
return accounts
|
||||
|
||||
def _set_company_currency(self, cr, uid, ids, name, value, arg, context=None):
|
||||
if type(ids) != type([]):
|
||||
if isinstance(ids, (int, long)):
|
||||
ids=[ids]
|
||||
for account in self.browse(cr, uid, ids, context=context):
|
||||
if account.company_id:
|
||||
|
|
Loading…
Reference in New Issue