report_category.py 623 B

1234567891011121314151617181920212223242526
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. def get_report_category():
  4. query = '''
  5. SELECT
  6. category.id,
  7. category.name,
  8. category.name_template,
  9. category.description,
  10. category.icon_code
  11. FROM report_category AS category
  12. ORDER BY category.sequence
  13. '''
  14. r.cr.execute(query)
  15. return [
  16. {
  17. 'id': j[0],
  18. 'name': j[1],
  19. 'name_template': j[2],
  20. 'description': j[3],
  21. 'icon_code': j[4],
  22. } for j in r.cr.fetchall()
  23. ]