diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-16 10:00:46 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-16 10:00:46 +0700 |
| commit | 62180e8170663bca8870f8b0348b5b2ded2d8621 (patch) | |
| tree | 3ab57e06aacba0a8e51e5e50dac90b2f2eb9f894 | |
| parent | e016af1d1ab8df064cbb852965173ab2d53093dd (diff) | |
fix notif check qty po
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index c27950fd..62be3405 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') |
