From b8bb3887d9ddb201b993ba187592bbb1f0b449c4 Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Fri, 21 Oct 2022 10:53:20 +0700 Subject: no message --- indoteknik_api/models/product_template.py | 7 +++---- 1 file 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 -- cgit v1.2.3