diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-07-24 03:31:59 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-07-24 03:31:59 +0000 |
| commit | c1ac22304b557b9982b5fb79d23d29b6faf48090 (patch) | |
| tree | a1e6db531a5bf19994374e895d5d8a8c9abf1ffa /indoteknik_api/models/product_template.py | |
| parent | 6966c00bf2ef2bd9c2261d9363ac6b463a7766dd (diff) | |
| parent | 30909e82d7ff1f3cac4700e284f80552a0d38523 (diff) | |
Merged in feature/voucher-cart (pull request #65)
Feature/voucher cart
Diffstat (limited to 'indoteknik_api/models/product_template.py')
| -rw-r--r-- | indoteknik_api/models/product_template.py | 6 |
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"]: |
