summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/product_template.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-04-28 09:03:04 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-04-28 09:03:04 +0700
commit57d55f545da0fc501a9828bb3ca2988f126b241a (patch)
tree75b98126546eea20b90ca777b2887b4813946871 /indoteknik_api/models/product_template.py
parent3592c254ca5baf4a0a769f500f9e28a9cbc272a7 (diff)
parent6fa5de951abc02884eb37cdc6786c0f3d141ccc5 (diff)
Merge branch 'staging' into release
Diffstat (limited to 'indoteknik_api/models/product_template.py')
-rw-r--r--indoteknik_api/models/product_template.py4
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)