summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/automatic_purchase.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2026-02-24 13:20:33 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2026-02-24 13:20:33 +0700
commit316b8257845d0df10153fa7e5e294a699ad17c56 (patch)
tree78337836f0cc61e1af8e1549dc22f907a1d2dcee /indoteknik_custom/models/automatic_purchase.py
parent345d45f5fae0f152ca39e9ba491513582a5c6791 (diff)
push
Diffstat (limited to 'indoteknik_custom/models/automatic_purchase.py')
-rw-r--r--indoteknik_custom/models/automatic_purchase.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py
index 0b2f7d1b..3035ceab 100644
--- a/indoteknik_custom/models/automatic_purchase.py
+++ b/indoteknik_custom/models/automatic_purchase.py
@@ -744,7 +744,10 @@ class SaleNotInMatchPO(models.Model):
select distinct coalesce(posm.sale_line_id,0)
from purchase_order_sales_match posm
join purchase_order po on po.id = posm.purchase_order_id
+ join purchase_order_line pol on pol.order_id = posm.purchase_order_id and pol.product_id = posm.product_id
+ join stock_move sm on sm.purchase_line_id = pol.id
where po.state not in ('cancel')
+ and sm.state not in ('cancel')
)
)
""" % self._table) \ No newline at end of file