mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 13:09:17 +00:00
fix: Set item locations before save
This commit is contained in:
@@ -16,6 +16,9 @@ from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note a
|
|||||||
# TODO: Prioritize SO or WO group warehouse
|
# TODO: Prioritize SO or WO group warehouse
|
||||||
|
|
||||||
class PickList(Document):
|
class PickList(Document):
|
||||||
|
def before_save(self):
|
||||||
|
self.set_item_locations()
|
||||||
|
|
||||||
def before_submit(self):
|
def before_submit(self):
|
||||||
for item in self.locations:
|
for item in self.locations:
|
||||||
if not frappe.get_cached_value('Item', item.item_code, 'has_serial_no'):
|
if not frappe.get_cached_value('Item', item.item_code, 'has_serial_no'):
|
||||||
@@ -56,7 +59,7 @@ class PickList(Document):
|
|||||||
self.append('locations', location)
|
self.append('locations', location)
|
||||||
|
|
||||||
def aggregate_item_qty(self):
|
def aggregate_item_qty(self):
|
||||||
locations = self.locations
|
locations = self.get('locations')
|
||||||
self.item_count_map = {}
|
self.item_count_map = {}
|
||||||
# aggregate qty for same item
|
# aggregate qty for same item
|
||||||
item_map = frappe._dict()
|
item_map = frappe._dict()
|
||||||
|
|||||||
Reference in New Issue
Block a user