fix: Set item locations before save
diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py
index 128ad25..06bb247 100644
--- a/erpnext/stock/doctype/pick_list/pick_list.py
+++ b/erpnext/stock/doctype/pick_list/pick_list.py
@@ -16,6 +16,9 @@
# TODO: Prioritize SO or WO group warehouse
class PickList(Document):
+ def before_save(self):
+ self.set_item_locations()
+
def before_submit(self):
for item in self.locations:
if not frappe.get_cached_value('Item', item.item_code, 'has_serial_no'):
@@ -56,7 +59,7 @@
self.append('locations', location)
def aggregate_item_qty(self):
- locations = self.locations
+ locations = self.get('locations')
self.item_count_map = {}
# aggregate qty for same item
item_map = frappe._dict()