diff options
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 6 |
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, |
