From 9641edc5626e63bda8be72ef6eb2a70a495c02a1 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Thu, 29 Aug 2019 22:23:13 +0530 Subject: [PATCH] fix: Set item locations before save --- erpnext/stock/doctype/pick_list/pick_list.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index 128ad2504d..06bb247d4e 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -16,6 +16,9 @@ from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note a # 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 @@ class PickList(Document): 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()