mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
test: patch: add test case and patch
This commit is contained in:
12
erpnext/patches/v16_0/set_mr_picked_qty.py
Normal file
12
erpnext/patches/v16_0/set_mr_picked_qty.py
Normal 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)
|
||||
Reference in New Issue
Block a user