summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/product_template.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-07-24 08:38:12 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-07-24 08:38:12 +0000
commitc344ccd81208b5b466ae047dbb9e084dd5d0f358 (patch)
treec07caf6a1df48719b828fbe270bb62ccc3e0c947 /indoteknik_api/models/product_template.py
parent989002aca3ed9b1e724e9b98d8ca3513ba598663 (diff)
parent2ad6b4ecf783b5dfe0d4aa11f238cbf6aefd9747 (diff)
Merged in production (pull request #66)
Production
Diffstat (limited to 'indoteknik_api/models/product_template.py')
-rw-r--r--indoteknik_api/models/product_template.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/indoteknik_api/models/product_template.py b/indoteknik_api/models/product_template.py
index 1a345967..68ab79c2 100644
--- a/indoteknik_api/models/product_template.py
+++ b/indoteknik_api/models/product_template.py
@@ -51,9 +51,7 @@ class ProductTemplate(models.Model):
data.update(data_with_detail)
return data
- 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)
+ def v2_api_single_response(self, product_template, with_detail=''):
data = {
'id': product_template.id,
'image': self.env['ir.attachment'].api_image('product.template', 'image_128', product_template.id),
@@ -67,7 +65,7 @@ class ProductTemplate(models.Model):
}
if with_detail != '':
- variants = [self.env['product.product'].v2_api_single_response(variant, pricelist=pricelist) for variant in product_template.product_variant_ids]
+ variants = [self.env['product.product'].v2_api_single_response(variant) for variant in product_template.product_variant_ids]
lowest_price = variants[0]['price']
for variant in variants:
if variant["price"]["price_discount"] < lowest_price["price_discount"]: