From d80c3cd162d3b866cc714ea6dbd461e166f3c587 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 9 Feb 2024 11:14:54 +0530 Subject: [PATCH] fix: warehouse issue in pick list (#39826) (cherry picked from commit 159a123dc79cd0a8ed6e6caa1532bc026264058f) --- erpnext/stock/doctype/pick_list/pick_list.js | 3 +++ erpnext/stock/doctype/pick_list/pick_list.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/pick_list/pick_list.js b/erpnext/stock/doctype/pick_list/pick_list.js index aa0e12549681..3cc2956e96b8 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.js +++ b/erpnext/stock/doctype/pick_list/pick_list.js @@ -77,6 +77,9 @@ frappe.ui.form.on('Pick List', { }, freeze: 1, freeze_message: __("Setting Item Locations..."), + callback(r) { + refresh_field("locations"); + } }); } }, diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index 98ed569af1eb..0e1f8d78b840 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -348,9 +348,9 @@ def set_item_locations(self, save=False): picked_items_details = self.get_picked_items_details(items) self.item_location_map = frappe._dict() - from_warehouses = None + from_warehouses = [self.parent_warehouse] if self.parent_warehouse else [] if self.parent_warehouse: - from_warehouses = get_descendants_of("Warehouse", self.parent_warehouse) + from_warehouses.extend(get_descendants_of("Warehouse", self.parent_warehouse)) # Create replica before resetting, to handle empty table on update after submit. locations_replica = self.get("locations")