diff options
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/purchasing_job.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index 35dffc48..f5b1baf9 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -396,7 +396,7 @@ class AutomaticPurchase(models.Model): domain = [ ('product_id', '=', line.product_id.id) ] - sale = self.env['v.sales.outstanding'].search(domain, order='create_date desc', limit=1) + sale = self.env['v.sales.outstanding'].search(domain, order='sale_order_create_date desc', limit=1) existing_match = self.env['automatic.purchase.sales.match'].search([ ('automatic_purchase_id', '=', self.id), diff --git a/indoteknik_custom/models/purchasing_job.py b/indoteknik_custom/models/purchasing_job.py index 810a9e65..6e4f239d 100644 --- a/indoteknik_custom/models/purchasing_job.py +++ b/indoteknik_custom/models/purchasing_job.py @@ -96,7 +96,7 @@ class PurchasingJob(models.Model): ) AS sub ON sub.product_id = pmp.product_id LEFT JOIN latest_purchase_orders po ON po.product_id = pmp.product_id LEFT JOIN random_user_ids ru ON ru.vendor_id = sub.vendor_id OR (ru.vendor_id IS NULL AND sub.vendor_id != 9688) - WHERE pmp.po_number = 'kosong' and pmp.action = 'kurang' + WHERE pmp.action = 'kurang' AND sub.vendor_id IS NOT NULL GROUP BY pmp.product_id, |
