product_attribute.py 350 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. def get_product_attribute():
  4. query = '''
  5. SELECT
  6. id,
  7. name
  8. FROM product_attribute
  9. '''
  10. r.cr.execute(query)
  11. return [
  12. {
  13. 'id': j[0],
  14. 'name': j[1],
  15. } for j in r.cr.fetchall()
  16. ]