mirror of
https://github.com/frappe/erpnext.git
synced 2025-12-03 18:35:36 +00:00
fix: incorrect query/function logic
This commit is contained in:
@@ -1998,22 +1998,14 @@ def get_reserved_qty_for_production_plan(item_code, warehouse):
|
|||||||
return reserved_qty_for_production_plan - reserved_qty_for_production
|
return reserved_qty_for_production_plan - reserved_qty_for_production
|
||||||
|
|
||||||
|
|
||||||
@frappe.request_cache
|
|
||||||
def get_non_completed_production_plans():
|
def get_non_completed_production_plans():
|
||||||
table = frappe.qb.DocType("Production Plan")
|
table = frappe.qb.DocType("Production Plan")
|
||||||
child = frappe.qb.DocType("Production Plan Item")
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
frappe.qb.from_(table)
|
frappe.qb.from_(table)
|
||||||
.inner_join(child)
|
|
||||||
.on(table.name == child.parent)
|
|
||||||
.select(table.name)
|
.select(table.name)
|
||||||
.distinct()
|
.distinct()
|
||||||
.where(
|
.where((table.docstatus == 1) & (table.status.notin(["Completed", "Closed"])))
|
||||||
(table.docstatus == 1)
|
|
||||||
& (table.status.notin(["Completed", "Closed"]))
|
|
||||||
& (child.planned_qty > child.ordered_qty)
|
|
||||||
)
|
|
||||||
).run(pluck="name")
|
).run(pluck="name")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user