mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 00:25:01 +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:
|
||||
continue
|
||||
|
||||
sre_list = frappe.db.get_all(
|
||||
"Stock Reservation Entry",
|
||||
{
|
||||
"docstatus": 1,
|
||||
"voucher_type": "Sales Order",
|
||||
"voucher_no": item.get(so_field),
|
||||
"voucher_detail_no": item.so_detail,
|
||||
"warehouse": item.warehouse,
|
||||
"status": ["not in", ["Delivered", "Cancelled"]],
|
||||
},
|
||||
order_by="creation",
|
||||
table = frappe.qb.DocType("Stock Reservation Entry")
|
||||
query = (
|
||||
frappe.qb.from_(table)
|
||||
.select(table.name)
|
||||
.where(
|
||||
(table.docstatus == 1)
|
||||
& (table.voucher_type == "Sales Order")
|
||||
& (table.voucher_no == item.get(so_field))
|
||||
& (table.voucher_detail_no == item.so_detail)
|
||||
& (table.warehouse == item.warehouse)
|
||||
& (table.delivered_qty < table.reserved_qty)
|
||||
)
|
||||
.orderby(table.creation)
|
||||
)
|
||||
sre_list = query.run(pluck="name")
|
||||
|
||||
# Skip if no Stock Reservation Entries.
|
||||
if not sre_list:
|
||||
|
||||
@@ -1425,7 +1425,7 @@ class StockReservation:
|
||||
)
|
||||
.where(
|
||||
(sre.docstatus == 1)
|
||||
& (sre.status.notin(["Delivered", "Cancelled", "Draft", "Closed"]))
|
||||
& (sre.delivered_qty < sre.reserved_qty)
|
||||
& (sre.voucher_type == doctype)
|
||||
& (sre.voucher_no.isin(docnames))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user