From 7897614cee8a347dfdd933df72db95859cb1a558 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 30 Apr 2025 16:43:38 +0700 Subject: fixing handle 15 pm, weekend, and holidays --- indoteknik_custom/models/product_template.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indoteknik_custom/models/product_template.py') diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index e6a01a04..56ae3087 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -341,6 +341,9 @@ class ProductTemplate(models.Model): 'search_key':[item_code], } response = requests.post(url, headers=headers, json=json_data) + if response.status_code != 200: + return 0 + datas = json.loads(response.text)['data'] qty = 0 for data in datas: -- cgit v1.2.3 From c4aebb9fc2cb875554b26e21231de0ad0bfd48ce Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 27 May 2025 10:38:38 +0700 Subject: add qty outgoing manufacturing order formula in free qty --- indoteknik_custom/models/product_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom/models/product_template.py') diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 3bb54f44..2c07824a 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -1146,7 +1146,7 @@ class ProductProduct(models.Model): def _get_qty_free_bandengan(self): for product in self: - qty_free = product.qty_onhand_bandengan - product.qty_outgoing_bandengan + qty_free = product.qty_onhand_bandengan - product.qty_outgoing_bandengan - product.qty_outgoing_mo_bandengan product.qty_free_bandengan = qty_free def _get_max_qty_reordering_rule(self): -- cgit v1.2.3