mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
fix: modify all remaining SRE queries to consider new Closed status
This commit is contained in:
@@ -855,18 +855,21 @@ class SellingController(StockController):
|
|||||||
if not item.get(so_field) or not item.so_detail:
|
if not item.get(so_field) or not item.so_detail:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
sre_list = frappe.db.get_all(
|
table = frappe.qb.DocType("Stock Reservation Entry")
|
||||||
"Stock Reservation Entry",
|
query = (
|
||||||
{
|
frappe.qb.from_(table)
|
||||||
"docstatus": 1,
|
.select(table.name)
|
||||||
"voucher_type": "Sales Order",
|
.where(
|
||||||
"voucher_no": item.get(so_field),
|
(table.docstatus == 1)
|
||||||
"voucher_detail_no": item.so_detail,
|
& (table.voucher_type == "Sales Order")
|
||||||
"warehouse": item.warehouse,
|
& (table.voucher_no == item.get(so_field))
|
||||||
"status": ["not in", ["Delivered", "Cancelled"]],
|
& (table.voucher_detail_no == item.so_detail)
|
||||||
},
|
& (table.warehouse == item.warehouse)
|
||||||
order_by="creation",
|
& (table.delivered_qty < table.reserved_qty)
|
||||||
|
)
|
||||||
|
.orderby(table.creation)
|
||||||
)
|
)
|
||||||
|
sre_list = query.run(pluck="name")
|
||||||
|
|
||||||
# Skip if no Stock Reservation Entries.
|
# Skip if no Stock Reservation Entries.
|
||||||
if not sre_list:
|
if not sre_list:
|
||||||
|
|||||||
@@ -1425,7 +1425,7 @@ class StockReservation:
|
|||||||
)
|
)
|
||||||
.where(
|
.where(
|
||||||
(sre.docstatus == 1)
|
(sre.docstatus == 1)
|
||||||
& (sre.status.notin(["Delivered", "Cancelled", "Draft", "Closed"]))
|
& (sre.delivered_qty < sre.reserved_qty)
|
||||||
& (sre.voucher_type == doctype)
|
& (sre.voucher_type == doctype)
|
||||||
& (sre.voucher_no.isin(docnames))
|
& (sre.voucher_no.isin(docnames))
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user