From 300b68ec510194e5d73abcfc775c3cca945d3718 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 15 Apr 2024 10:45:04 +0700 Subject: fix bug automatic purchase --- indoteknik_custom/models/automatic_purchase.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index 6e11fd78..fc8de27d 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', 'in', [lines.product_id.id]) + ('product_id', '=', lines.product_id.id) ], limit=1) po = self.env['purchase.order'].search([ - ('product_id', 'in', [lines.product_id.id]), - ('order_sales_match_line.sale_id', 'in', [lines.automatic_purchase_id.sales_match.sale_id.id]), + ('product_id', '=', lines.product_id.id), + ('order_sales_match_line.sale_id', '=', 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') -- cgit v1.2.3