set @UOM = ‘PKT 100 PCS’, @item_code=‘5426’;
update tabItem set stock_uom=@UOM where name in (@item_code);
update tabUOM Conversion Detail set uom=@UOM where parent in (@item_code) and conversion_factor=1;
update tabBin set stock_uom=@UOM where item_code in (@item_code);
update tabStock Ledger Entry set stock_uom=@UOM where item_code in (@item_code);
before you run this script, test it on a development server first.
yes Nabin you are right, we are skipping , purchase, receipt , sales, order etc intentionally and the above script will fix the Stock realted entries and will work fine for all future transactions.
Step 1: first update items in purchase order or another doctype
Step 2: update price list of item
Step 3: update Bin stock uom
Step 4: item UOM update
This is query of update BIN stock UOM in system console
item_code = “any” # Replace with your item code
new_stock_uom = “any” # Replace with your desired Stock UOM