diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2022-10-24 11:45:36 +0700 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2022-10-24 11:45:36 +0700 |
| commit | e0d9fdcfd618332d6324c244859e9cbbf3a6a225 (patch) | |
| tree | 2b5a3a44cbe6796dd2d20eec00810eef04ba1f02 | |
| parent | b8bb3887d9ddb201b993ba187592bbb1f0b449c4 (diff) | |
Product similar result without its id
Product result discount percentage limit float length
| -rw-r--r-- | indoteknik_api/controllers/api_v1/product.py | 2 | ||||
| -rw-r--r-- | indoteknik_api/models/product_pricelist.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py index bd67e380..0d5d89b6 100644 --- a/indoteknik_api/controllers/api_v1/product.py +++ b/indoteknik_api/controllers/api_v1/product.py @@ -87,7 +87,7 @@ class Product(controller.Controller): if not product_template: return self.response([]) - query = [] + query = [('id', '!=', id)] if product_template.x_manufacture: query.append(('x_manufacture', '=', product_template.x_manufacture.id)) if product_template.public_categ_ids: diff --git a/indoteknik_api/models/product_pricelist.py b/indoteknik_api/models/product_pricelist.py index 2cd1eb9f..6a011934 100644 --- a/indoteknik_api/models/product_pricelist.py +++ b/indoteknik_api/models/product_pricelist.py @@ -55,7 +55,7 @@ class ProductPricelist(models.Model): return { 'price': price, 'price_discount': price_discount, - 'discount_percentage': discount_percentage + 'discount_percentage': float("%.2f" % discount_percentage) } def get_lowest_product_variant_price(self, product_template: dict, pricelist_id: int): |
