diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-07-05 11:41:59 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-07-05 11:41:59 +0700 |
| commit | 1d2630176847cb16fa5570ee4bd952e7965d48ca (patch) | |
| tree | f5132ef4e64433daa580f448df64cb2ebba7c715 /indoteknik_api/controllers/api_v1 | |
| parent | 04ea7cdfbc49da9ecb060dbd87a8cfa103d31ccc (diff) | |
refactor product api altama
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/product.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 = { |
