# -*- coding: utf-8 -*- from openerp.http import request as r def get_report_category(): query = ''' SELECT category.id, category.name, category.name_template, category.description, category.icon_code FROM report_category AS category ORDER BY category.sequence ''' r.cr.execute(query) return [ { 'id': j[0], 'name': j[1], 'name_template': j[2], 'description': j[3], 'icon_code': j[4], } for j in r.cr.fetchall() ]