Revert "Fixes for uom in get_item_details (#10986)" (#11009)
This reverts commit 5b58e489a8d29ad7242d8b9bba0da292d85d19b6.
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index a9677b0..d04143d 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -187,6 +187,9 @@
if stock_qty != len(get_serial_nos(item.get('serial_no'))):
item.set(fieldname, value)
+ elif fieldname == "conversion_factor" and not item.get("conversion_factor"):
+ item.set(fieldname, value)
+
if ret.get("pricing_rule"):
# if user changed the discount percentage then set user's discount percentage ?
item.set("discount_percentage", ret.get("discount_percentage"))
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 539e8a5..72a83c6 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -164,15 +164,6 @@
warehouse = user_default_warehouse or item.default_warehouse or args.warehouse
- #Set the UOM to the Default Sales UOM or Default Purchase UOM if configured in the Item Master
- if not args.uom:
- if args.get('doctype') in ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']:
- args.uom = item.sales_uom if item.sales_uom else item.stock_uom
- elif args.get('doctype') in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']:
- args.uom = item.purchase_uom if item.purchase_uom else item.stock_uom
- else:
- args.uom = item.stock_uom
-
out = frappe._dict({
"item_code": item.name,
"item_name": item.item_name,
@@ -187,7 +178,7 @@
"batch_no": None,
"item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in
item.get("taxes")))),
- "uom": args.uom,
+ "uom": item.stock_uom,
"min_order_qty": flt(item.min_order_qty) if args.doctype == "Material Request" else "",
"qty": args.qty or 1.0,
"stock_qty": args.qty or 1.0,