[FIX] point_of_sale: correct pos.category name_get() to show whole hierarchy
This commit is contained in:
parent
7eb9c7e1f5
commit
ba5978afef
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue