diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2022-10-21 10:53:20 +0700 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2022-10-21 10:53:20 +0700 |
| commit | b8bb3887d9ddb201b993ba187592bbb1f0b449c4 (patch) | |
| tree | a37bc7ac51b182ecb0bbef8376eeadaa61a1f3db | |
| parent | d4b46663d5e625cfabf52f7663c1f876ce202c26 (diff) | |
no message
| -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 |
