[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):
|
def name_get(self, cr, uid, ids, context=None):
|
||||||
if not len(ids):
|
|
||||||
return []
|
|
||||||
reads = self.browse(cr, uid, ids, context=context)
|
|
||||||
res = []
|
res = []
|
||||||
for record in reads:
|
for cat in self.browse(cr, uid, ids, context=context):
|
||||||
if record.parent_id:
|
names = [cat.name]
|
||||||
name = '%s / %s' % (record.parent_id.name, record.name)
|
pcat = cat.parent_id
|
||||||
else:
|
while pcat:
|
||||||
name = record.name
|
names.append(pcat.name)
|
||||||
res.append((record.id, name))
|
pcat = pcat.parent_id
|
||||||
|
res.append((cat.id, ' / '.join(reversed(names))))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
|
def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
|
||||||
|
|
Loading…
Reference in New Issue