|
@@ -16,13 +16,21 @@ class ProductTemplate(models.Model):
|
|
|
for variant in product.product_variant_ids:
|
|
|
if not variant.active:
|
|
|
continue
|
|
|
+
|
|
|
+ prices = []
|
|
|
attributes = []
|
|
|
|
|
|
+ for price in variant.product_tmpl_id.pricelist_item_ids.filtered(lambda x: x.product_id.id == variant.id):
|
|
|
+ prices.append({
|
|
|
+ 'id': price.id,
|
|
|
+ 'price': price.price_surcharge
|
|
|
+ })
|
|
|
+
|
|
|
# map product attribute
|
|
|
for attribute_value in variant.attribute_value_ids:
|
|
|
attributes.append({
|
|
|
'id': attribute_value.id,
|
|
|
- 'name': attribute_value.name,
|
|
|
+ 'price': attribute_value.name,
|
|
|
'display_name': attribute_value.display_name
|
|
|
})
|
|
|
|
|
@@ -34,8 +42,10 @@ class ProductTemplate(models.Model):
|
|
|
'list_price': variant.list_price,
|
|
|
'name': variant.name,
|
|
|
'qty_available': variant.qty_available,
|
|
|
+ 'prices': prices,
|
|
|
'attributes': attributes
|
|
|
})
|
|
|
+
|
|
|
products.append({
|
|
|
'id': product.id,
|
|
|
'display_name': product.display_name,
|