product_attribute_value.py 663 B

1234567891011121314151617181920212223
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. def get_product_attribute_value():
  4. query = '''
  5. SELECT
  6. attribute_value.id,
  7. attribute_value.name,
  8. attribute_value.attribute_id,
  9. attribute.name
  10. FROM product_attribute_value AS attribute_value
  11. LEFT JOIN product_attribute AS attribute
  12. ON attribute.id = attribute_value.attribute_id
  13. '''
  14. r.cr.execute(query)
  15. return [
  16. {
  17. 'id': j[0],
  18. 'name': j[1],
  19. 'attribute_id': j[2],
  20. 'attribute_name': j[3],
  21. } for j in r.cr.fetchall()
  22. ]