fix: warn user pick list is not complete instead of auto fulfilling picked_qty.

This commit is contained in:
Devin Slauenwhite 2022-04-29 16:28:49 -04:00
parent 48128911be
commit 5f8f83c6d8

View File

@ -42,8 +42,14 @@ class PickList(Document):
update_sales_orders = set() update_sales_orders = set()
for item in self.locations: for item in self.locations:
# if the user has not entered any picked qty, set it to stock_qty, before submit # if the user has not entered any picked qty, set it to stock_qty, before submit
if item.picked_qty == 0: if item.picked_qty < item.stock_qty:
item.picked_qty = item.stock_qty frappe.msgprint(
_("Row {0} is short by {1} {2}").format(
item.idx, item.stock_qty - item.picked_qty, item.stock_uom
),
_("Warning: Pick List Incomplete"),
indicator="yellow",
)
if item.sales_order_item: if item.sales_order_item:
# update the picked_qty in SO Item # update the picked_qty in SO Item