summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-12-18 14:06:16 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-12-18 14:06:16 +0700
commit955f0eff6fb1917c3cf0fde8ee6994ee43148732 (patch)
treee29ed9a9ee3a1a6a91fac4661778adad74069736 /indoteknik_custom/models/purchase_order.py
parent8fc9eddc57f76f62c3efaa70c9a3aee8be1911fa (diff)
change field suggest po
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 177a4744..285c5a95 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -214,6 +214,7 @@ class PurchaseOrder(models.Model):
# 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,
@@ -224,6 +225,9 @@ class PurchaseOrder(models.Model):
'so_line_id': order_line.id,
}
self.order_line.create(values)
+ for order_line in self.order_line:
+ order_line.suggest_purchasing()
+
def compute_count_line_product(self):
for order in self: