diff options
| -rw-r--r-- | indoteknik_api/models/product_template.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/indoteknik_api/models/product_template.py b/indoteknik_api/models/product_template.py index 5c81dec4..477be2f3 100644 --- a/indoteknik_api/models/product_template.py +++ b/indoteknik_api/models/product_template.py @@ -27,16 +27,15 @@ class ProductTemplate(models.Model): 'description': product_template.website_description or '', } for variant in product_template.product_variant_ids: - variant_data = { + detail_data['variants'].append({ 'id': variant.id, 'code': variant.default_code or '', 'name': variant.display_name, 'price': self.env['product.pricelist'].compute_price(product_pricelist_default_discount_id, variant.id), 'stock': variant.qty_stock_vendor, 'weight': variant.weight, - 'attribute': [x.name for x in variant.product_template_attribute_value_ids] - } - detail_data['variants'].append(variant_data) + 'attributes': [x.name for x in variant.product_template_attribute_value_ids] + }) data.update(detail_data) return data |
