diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-15 10:45:04 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-15 10:45:04 +0700 |
| commit | 300b68ec510194e5d73abcfc775c3cca945d3718 (patch) | |
| tree | ea57a60ae3731295619640affe024a0cd5c8426a | |
| parent | 84c48d915c551a5454ce5a32f1554322f6d2847c (diff) | |
fix bug automatic purchase
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 8 |
1 files 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') |
