From 1d2630176847cb16fa5570ee4bd952e7965d48ca Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 5 Jul 2023 11:41:59 +0700 Subject: refactor product api altama --- indoteknik_api/controllers/api_v1/product.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indoteknik_api/controllers/api_v1') diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py index b2bb6139..74dadb01 100644 --- a/indoteknik_api/controllers/api_v1/product.py +++ b/indoteknik_api/controllers/api_v1/product.py @@ -27,6 +27,7 @@ class Product(controller.Controller): qty = 0 sla_date = '-' qty_available = 0 + product_altama = product.x_manufacture.id == 10 or product.x_manufacture.id == 122 or product.x_manufacture.id == 89 for stock in product.stock_quant_ids: if stock.location_id.id == stock_location_id: @@ -41,19 +42,18 @@ class Product(controller.Controller): qty = 0 sla_date = 'Indent' elif qty_available > 10: - if product.x_manufacture.id == 10 or product.x_manufacture.id == 122 or product.x_manufacture.id == 89: + if product_altama: qty = qty_available + qty_b2b_altama sla_date = '2-4 Hari' else: qty = qty_available sla_date = '1 Hari' elif qty_available < 10: - if qty_b2b_altama > 0 and qty_available > 0: + if qty_b2b_altama > 0 and qty_available > 0 and product_altama: qty = qty_b2b_altama + qty_available sla_date = '2-4 Hari' else: qty = 0 - sla_date = '-' data = { -- cgit v1.2.3