diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-18 15:45:05 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-18 15:45:05 +0700 |
| commit | 60d754cb1b2044adafddd4893212028a3264f620 (patch) | |
| tree | 4b034580ffe571245c3b7b51810a50952b70d53d /indoteknik_api/models/product_template.py | |
| parent | 456d4b07e52c3664fd2c22e2b7748cbb2912539d (diff) | |
price tier on user session, variant and product
Diffstat (limited to 'indoteknik_api/models/product_template.py')
| -rw-r--r-- | indoteknik_api/models/product_template.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/indoteknik_api/models/product_template.py b/indoteknik_api/models/product_template.py index 4d16727f..b9df0f5f 100644 --- a/indoteknik_api/models/product_template.py +++ b/indoteknik_api/models/product_template.py @@ -51,7 +51,7 @@ class ProductTemplate(models.Model): data.update(data_with_detail) return data - def v2_api_single_response(self, product_template, with_detail=''): + def v2_api_single_response(self, product_template, pricelist=False, with_detail=''): product_pricelist_default_discount_id = self.env['ir.config_parameter'].get_param('product.pricelist.default_discount_id') product_pricelist_default_discount_id = int(product_pricelist_default_discount_id) data = { @@ -71,7 +71,7 @@ class ProductTemplate(models.Model): data_with_detail = { 'image': self.env['ir.attachment'].api_image('product.template', 'image_512', product_template.id), 'display_name': product_template.display_name, - 'variants': [self.env['product.product'].v2_api_single_response(variant) for variant in product_template.product_variant_ids], + 'variants': [self.env['product.product'].v2_api_single_response(variant, pricelist=pricelist) for variant in product_template.product_variant_ids], 'description': product_template.website_description or '', } data.update(data_with_detail) |
