From 2f3dcc2137ab9b122992c40f8faa07c8361b151d Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 13 Mar 2025 18:33:39 +0530 Subject: [PATCH 1/2] fix: UOM conversion error when creating pick list from material transfer request (cherry picked from commit 840ea070a9514a88e83b51b3446c7ae9724062fe) --- erpnext/stock/doctype/pick_list/pick_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index a80a59a822d..f7bd4657973 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -838,7 +838,7 @@ def get_items_with_location_and_quantity(item_doc, item_location_map, docstatus) item_location = frappe._dict(item_location) stock_qty = remaining_stock_qty if item_location.qty >= remaining_stock_qty else item_location.qty - qty = stock_qty / (item_doc.conversion_factor or 1) + qty = stock_qty * (item_doc.conversion_factor or 1) uom_must_be_whole_number = frappe.get_cached_value("UOM", item_doc.uom, "must_be_whole_number") if uom_must_be_whole_number: From be3e083e7d07ef460ddfe7918511b5f5ac6d6b1a Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 13 Mar 2025 20:19:47 +0530 Subject: [PATCH 2/2] fix: wrong field mapping (cherry picked from commit 8411e2e01f066b8b49049a94f3859079124f4019) --- erpnext/stock/doctype/material_request/material_request.py | 2 +- erpnext/stock/doctype/pick_list/pick_list.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 69572e661f8..59634cb9f7c 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -813,7 +813,7 @@ def create_pick_list(source_name, target_doc=None): }, "Material Request Item": { "doctype": "Pick List Item", - "field_map": {"name": "material_request_item", "qty": "stock_qty"}, + "field_map": {"name": "material_request_item", "stock_qty": "stock_qty"}, }, }, target_doc, diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index f7bd4657973..a80a59a822d 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -838,7 +838,7 @@ def get_items_with_location_and_quantity(item_doc, item_location_map, docstatus) item_location = frappe._dict(item_location) stock_qty = remaining_stock_qty if item_location.qty >= remaining_stock_qty else item_location.qty - qty = stock_qty * (item_doc.conversion_factor or 1) + qty = stock_qty / (item_doc.conversion_factor or 1) uom_must_be_whole_number = frappe.get_cached_value("UOM", item_doc.uom, "must_be_whole_number") if uom_must_be_whole_number: