mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
* 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:
11
erpnext/patches/v16_0/uom_category.py
Normal file
11
erpnext/patches/v16_0/uom_category.py
Normal 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)
|
||||
Reference in New Issue
Block a user