# -*- coding: utf-8 -*- from openerp.http import request as r _MODEL = 'product.category' def get_categories(): domain = [ ('type', '!=', 'view'), ('child_id', '=', False) ] return [ { 'id': c.id, 'name': c.display_name, 'completeName': c.complete_name, 'parent': { 'id': c.parent_id.id, 'name': c.parent_id.display_name, 'completeName': c.parent_id.complete_name } } for c in r.env[_MODEL].search(domain) ]