diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-12-19 13:51:21 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-12-19 13:51:21 +0700 |
| commit | 7ad7c2a6c7cc7106d1c21f0f8da009f586015bc3 (patch) | |
| tree | 5459965a70e80be1916bba0d0d368387f57b5e9f /indoteknik_custom/models/purchase_order_line.py | |
| parent | 955f0eff6fb1917c3cf0fde8ee6994ee43148732 (diff) | |
refactor qty on purchase
Diffstat (limited to 'indoteknik_custom/models/purchase_order_line.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order_line.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py index f1c20106..ca0e77ab 100755 --- a/indoteknik_custom/models/purchase_order_line.py +++ b/indoteknik_custom/models/purchase_order_line.py @@ -36,7 +36,7 @@ class PurchaseOrderLine(models.Model): def suggest_purchasing(self): for line in self: - if line.qty_available < 0: + if line.qty_available < line.product_qty: line.suggest = 'harus beli' else: line.suggest = 'masih cukup' @@ -57,10 +57,10 @@ class PurchaseOrderLine(models.Model): def _compute_qty_stock(self): for line in self: - line.qty_available = line.product_id.virtual_available - line.qty_onhand = line.product_id.qty_available - line.qty_incoming = line.product_id.incoming_qty - line.qty_outgoing = line.product_id.outgoing_qty + line.qty_available = line.product_id.qty_available_bandengan + line.qty_onhand = line.product_id.qty_onhand_bandengan + line.qty_incoming = line.product_id.qty_incoming_bandengan + line.qty_outgoing = line.product_id.qty_outgoing_bandengan @api.onchange('product_id') def _onchange_product_custom(self): |
