[FIX] name_get of res.partner and res.partner.category, to accept an int as ids

bzr revid: rco@openerp.com-20120620095812-6kl28dcry2fx8op6
This commit is contained in:
Raphael Collet
2012-06-20 11:58:12 +02:00
parent d8839589d9
commit 03450a0fc8
+5 -1
View File
@@ -50,6 +50,8 @@ class res_partner_category(osv.osv):
context = {}
if context.get('partner_category_display') == 'short':
return super(res_partner_category, self).name_get(cr, uid, ids, context=context)
if isinstance(ids, (int, long)):
ids = [ids]
reads = self.read(cr, uid, ids, ['name','parent_id'], context=context)
res = []
for record in reads:
@@ -285,7 +287,9 @@ class res_partner(osv.osv):
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
if not len(ids):
if isinstance(ids, (int, long)):
ids = [ids]
if not ids:
return []
if context.get('show_ref'):
rec_name = 'ref'