summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2024-11-15 10:11:55 +0700
committerstephanchrst <stephanchrst@gmail.com>2024-11-15 10:11:55 +0700
commit513e38bb38e712a37f2d2b8427212f4e83950f5a (patch)
tree7e3e02559a6350e1b35d80ed89e4368cb912f2b9
parent0c0cf00f50f78bc74aeedd8096eb161673a4ada7 (diff)
cr qty available to available bandengan in generate reordering rule
-rw-r--r--indoteknik_custom/models/automatic_purchase.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py
index 46cc9fa5..4e96e6d4 100644
--- a/indoteknik_custom/models/automatic_purchase.py
+++ b/indoteknik_custom/models/automatic_purchase.py
@@ -466,9 +466,9 @@ class AutomaticPurchase(models.Model):
count = 0
for point in orderpoints:
# _logger.info('test %s' % point.product_id.name)
- if point.product_id.virtual_available > point.product_min_qty:
+ if point.product_id.qty_available_bandengan > point.product_min_qty:
continue
- qty_purchase = point.product_max_qty - point.product_id.virtual_available
+ qty_purchase = point.product_max_qty - point.product_id.qty_available_bandengan
po_line = self.env['purchase.order.line'].search([('product_id', '=', point.product_id.id), ('order_id.state', '=', 'done')], order='id desc', limit=1)
if self.vendor_id:
@@ -495,7 +495,7 @@ class AutomaticPurchase(models.Model):
'qty_purchase': qty_purchase,
'qty_min': point.product_min_qty,
'qty_max': point.product_max_qty,
- 'qty_available': point.product_id.virtual_available,
+ 'qty_available': point.product_id.qty_available_bandengan,
# 'partner_id': po_line.order_id.partner_id.id,
# 'last_price': po_line.price_unit,
'partner_id': vendor_id,