diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-06-27 09:54:00 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-06-27 09:54:00 +0700 |
| commit | 9704530832cbb70a8209e556a9a67a25fe8c11fc (patch) | |
| tree | 0c92d7c479fd81d998d2cc0dec8334b9dc6fa48c /indoteknik_custom/models/purchase_order.py | |
| parent | 72888c5c59078195420f6a6da3ae1c65766390d7 (diff) | |
| parent | 45dc1483342d9ec195c53711b5194e7ddf88b343 (diff) | |
Merge branch 'release' into nathan-dev
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 5aedb07b..13ff2931 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -151,22 +151,20 @@ class PurchaseOrder(models.Model): self.order_line.unlink() for order_line in self.sale_order_id.order_line: if order_line.product_id.id and order_line.product_id.id not in products_exception: - for order_line in self.sale_order_id.order_line: - - qty_available = order_line.product_id.qty_onhand_bandengan + order_line.product_id.qty_incoming_bandengan - order_line.product_id.outgoing_qty - - suggest = 'harus beli' - if qty_available > order_line.product_qty: - suggest = 'masih cukup' - values = { - 'order_id': self.id, - 'product_id': order_line.product_id.id, - 'name': order_line.product_id.display_name, - 'product_qty': order_line.product_qty, - 'qty_available_store': qty_available, - 'suggest': suggest, - } - self.order_line.create(values) + qty_available = order_line.product_id.qty_onhand_bandengan + order_line.product_id.qty_incoming_bandengan - order_line.product_id.outgoing_qty + + suggest = 'harus beli' + if qty_available > order_line.product_qty: + suggest = 'masih cukup' + values = { + 'order_id': self.id, + 'product_id': order_line.product_id.id, + 'name': order_line.product_id.display_name, + 'product_qty': order_line.product_qty, + 'qty_available_store': qty_available, + 'suggest': suggest, + } + self.order_line.create(values) def compute_count_line_product(self): for order in self: |
