Skip to content

Commit

Permalink
[FIX] point_of_sale: correct pos.category name_get() to show whole hi…
Browse files Browse the repository at this point in the history
…erarchy
  • Loading branch information
KangOl committed Jan 14, 2015
1 parent 7eb9c7e commit ba5978a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions addons/point_of_sale/point_of_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ba5978a

Please sign in to comment.