test: patch: add test case and patch

This commit is contained in:
Mihir Kandoi
2025-12-17 20:16:13 +05:30
parent 1778e2c564
commit 80933ec66b
3 changed files with 33 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
import frappe
def execute():
if data := frappe.get_all(
"Pick List Item",
filters={"material_request_item": ["is", "set"], "docstatus": 1},
fields=["material_request_item", {"SUM": "picked_qty", "as": "picked_qty"}],
group_by="material_request_item",
):
data = {d.material_request_item: {"picked_qty": d.picked_qty} for d in data}
frappe.db.bulk_update("Material Request Item", data)