refactor: add category field to uom (backport #54290) (#54325)

* refactor: add category field to uom (#54290)

(cherry picked from commit e04a2e6da2)

# Conflicts:
#	erpnext/patches.txt

* chore: resolve conflicts

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
mergify[bot]
2026-04-16 10:16:28 +00:00
committed by GitHub
parent b487f69b59
commit ead7744f81
7 changed files with 547 additions and 249 deletions

View File

@@ -0,0 +1,11 @@
import json
import frappe
def execute():
uom_data = json.loads(
open(frappe.get_app_path("erpnext", "setup", "setup_wizard", "data", "uom_data.json")).read()
)
bulk_update_dict = {uom["uom_name"]: {"category": uom["category"]} for uom in uom_data}
frappe.db.bulk_update("UOM", bulk_update_dict)