1234567891011121314151617181920212223 |
- # -*- coding: utf-8 -*-
- from openerp.http import request as r
- def get_product_attribute_value():
- query = '''
- SELECT
- attribute_value.id,
- attribute_value.name,
- attribute_value.attribute_id,
- attribute.name
- FROM product_attribute_value AS attribute_value
- LEFT JOIN product_attribute AS attribute
- ON attribute.id = attribute_value.attribute_id
- '''
- r.cr.execute(query)
- return [
- {
- 'id': j[0],
- 'name': j[1],
- 'attribute_id': j[2],
- 'attribute_name': j[3],
- } for j in r.cr.fetchall()
- ]
|