diff options
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/product.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py index 5ed6490c..a2a0779b 100644 --- a/indoteknik_api/controllers/api_v1/product.py +++ b/indoteknik_api/controllers/api_v1/product.py @@ -17,7 +17,7 @@ class Product(controller.Controller): id = kw.get('id') stock_location_id = 57 # Ubah dengan location_id yang diinginkan product = request.env['product.product'].search([('id', '=', id)], limit=1) - stock = product.qty_available + # stock = product.qty_available - 10 item_code = product.default_code qty_altama = request.env['product.template'].get_stock_altama(item_code) qty_altama -= int(qty_altama * 0.1) @@ -25,13 +25,14 @@ class Product(controller.Controller): qty_b2b_altama = rounded_qty_altama qty = 0 - sla_date = '-' + sla_date = '-' qty_available = 0 for stock in product.stock_quant_ids: - if stock.location_id.id == 57: + if stock.location_id.id == stock_location_id: qty_available += stock.quantity + qty_available -= 10 if qty_available == 0: if qty_b2b_altama > 0: qty = qty_b2b_altama |
