summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/automatic_purchase.py
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-04-03 15:28:40 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-04-03 15:28:40 +0700
commitd14835853441ededd858a188c96208d39dbfdb20 (patch)
tree37b3f9e0c26c6ef6e07ed631404b100b890ea337 /indoteknik_custom/models/automatic_purchase.py
parent760830d22f2e060e4038c3a06515f920ea251abd (diff)
parent260ba347c21b906972c14d834aa8d97c4e9f26f6 (diff)
Merge branch 'release' of bitbucket.org:altafixco/indoteknik-addons into release
Diffstat (limited to 'indoteknik_custom/models/automatic_purchase.py')
-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 e28f71f5..ca6b38ba 100644
--- a/indoteknik_custom/models/automatic_purchase.py
+++ b/indoteknik_custom/models/automatic_purchase.py
@@ -75,9 +75,9 @@ class AutomaticPurchase(models.Model):
count = 0
for point in orderpoints:
# _logger.info('test %s' % point.product_id.name)
- if point.product_id.qty_available > point.product_min_qty:
+ if point.product_id.virtual_available > point.product_min_qty:
continue
- qty_purchase = point.product_max_qty - point.product_id.qty_available
+ qty_purchase = point.product_max_qty - point.product_id.virtual_available
po_line = self.env['purchase.order.line'].search([('product_id', '=', point.product_id.id), ('order_id.state', '=', 'done')], limit=1)
if self.vendor_id:
@@ -97,7 +97,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.qty_available,
+ 'qty_available': point.product_id.virtual_available,
# 'partner_id': po_line.order_id.partner_id.id,
# 'last_price': po_line.price_unit,
'partner_id': vendor_id,