[FIX] point_of_sale: correct pos.category name_get() to show whole hierarchy

This commit is contained in:
Christophe Simonis 2015-01-14 16:06:43 +01:00
parent 7eb9c7e1f5
commit ba5978afef
1 changed files with 7 additions and 9 deletions

View File

@ -1352,16 +1352,14 @@ class pos_category(osv.osv):
]
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
reads = self.browse(cr, uid, ids, context=context)
res = []
for record in reads:
if record.parent_id:
name = '%s / %s' % (record.parent_id.name, record.name)
else:
name = record.name
res.append((record.id, name))
for cat in self.browse(cr, uid, ids, context=context):
names = [cat.name]
pcat = cat.parent_id
while pcat:
names.append(pcat.name)
pcat = pcat.parent_id
res.append((cat.id, ' / '.join(reversed(names))))
return res
def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):