summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-04-16 10:07:12 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-04-16 10:07:12 +0700
commit3c3f10d9ec7a5d1350d5627047975387193a473f (patch)
treece78679bec52cc2bee7da9b9aefec6436e223f87
parent62180e8170663bca8870f8b0348b5b2ded2d8621 (diff)
check qty po
-rw-r--r--indoteknik_custom/models/automatic_purchase.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py
index 62be3405..c27950fd 100644
--- a/indoteknik_custom/models/automatic_purchase.py
+++ b/indoteknik_custom/models/automatic_purchase.py
@@ -154,15 +154,15 @@ class AutomaticPurchase(models.Model):
def check_qty_po(self):
for lines in self.purchase_lines:
purchasing_job = self.env['v.purchasing.job'].search([
- ('product_id', '=', lines.product_id.id)
- ], limit=1)
+ ('product_id', 'in', [lines.product_id.id])
+ ])
po = self.env['purchase.order'].search([
- ('product_id', '=', lines.product_id.id),
- ('order_sales_match_line.sale_id', '=', lines.automatic_purchase_id.sales_match.sale_id.id),
+ ('product_id', 'in', [lines.product_id.id]),
+ # ('order_sales_match_line.sale_id', 'in', [lines.automatic_purchase_id.sales_match.sale_id.id]),
('state', 'not in', ['cancel']),
('from_apo', '=', True)
- ], limit=1)
+ ])
if not purchasing_job:
raise UserError('Beberapa product sudah terbuat po dan sudah terconfirm')