diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-13 09:50:57 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-13 09:50:57 +0700 |
| commit | 32bf7b115ec71e72d9cde58bfa3c0304c4b1ffcb (patch) | |
| tree | 19257db60cdd44a5527825825ab0032a2693f74d /indoteknik_custom/models/automatic_purchase.py | |
| parent | 3085bfa4333cbc99ed4a0e432c8313cf7009cd2a (diff) | |
| parent | 604ef36b09c2eb2cf89f5b592ab775ba87e0ce88 (diff) | |
Merge remote-tracking branch 'origin/staging' into real-stock
Diffstat (limited to 'indoteknik_custom/models/automatic_purchase.py')
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index 87319bf6..e21b411d 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -59,11 +59,18 @@ class AutomaticPurchase(models.Model): # new_po = self.env['purchase.order'].create([param_header]) brand_id = product.brand_id.id count += 10 + + qty_available = product.product_id.qty_onhand_bandengan + product.product_id.qty_incoming_bandengan - product.product_id.outgoing_qty + suggest = 'harus beli' + if qty_available > product.qty_purchase: + suggest = 'masih cukup' param_line = { 'order_id': new_po.id, 'sequence': count, 'product_id': product.product_id.id, 'product_qty': product.qty_purchase, + 'qty_available_store': qty_available, + 'suggest': suggest, 'product_uom_qty': product.qty_purchase, 'price_unit': product.last_price, } |
