diff options
Diffstat (limited to 'indoteknik_api/controllers/api_v1/promotion.py')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/promotion.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/indoteknik_api/controllers/api_v1/promotion.py b/indoteknik_api/controllers/api_v1/promotion.py index 948681fd..a3dbf0ba 100644 --- a/indoteknik_api/controllers/api_v1/promotion.py +++ b/indoteknik_api/controllers/api_v1/promotion.py @@ -73,20 +73,13 @@ class Promotion(controller.Controller): 'image': product['parent']['image'], 'name': product['parent']['name'], 'variant_total': len(product_template.product_variant_ids), - 'lowest_price': product['price'], + 'lowest_price': line.calculate_price(product['price']), 'stock_total': product['stock'], 'icon': { 'top': request.env['ir.attachment'].api_image('promotion.program', 'icon_top', line.program_id.id), 'bottom': request.env['ir.attachment'].api_image('promotion.program', 'icon_bottom', line.program_id.id) } }) - price = product['lowest_price']['price'] - if line.discount_type == 'percentage': - product['lowest_price']['discount_percentage'] = line.discount_amount - product['lowest_price']['price_discount'] = price - (price * line.discount_amount / 100) - if line.discount_type == 'fixed_price': - product['lowest_price']['price_discount'] = line.discount_amount - product['lowest_price']['discount_percentage'] = round((price - line.discount_amount) / price * 100) product.pop('parent', None) product.pop('price', None) |
