[FIX] product: avoid a traceback in the product_category#name_get method if the ids is an integer

bzr revid: stw@openerp.com-20120821090145-pp2jm318g0kyn9wi
This commit is contained in:
Stephane Wirtel
2012-08-21 11:01:45 +02:00
parent bc1f8e6d4b
commit 219aff63af
+3 -1
View File
@@ -208,8 +208,10 @@ product_ul()
class product_category(osv.osv):
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
if isinstance(ids, (list, tuple)) and not len(ids):
return []
if isinstance(ids, (long, int)):
ids = [ids]
reads = self.read(cr, uid, ids, ['name','parent_id'], context=context)
res = []
for record in reads: