fix: auto-fulfill picking list when not in scan mode
diff --git a/erpnext/stock/doctype/pick_list/pick_list.json b/erpnext/stock/doctype/pick_list/pick_list.json
index f32a05a..f2d7543 100644
--- a/erpnext/stock/doctype/pick_list/pick_list.json
+++ b/erpnext/stock/doctype/pick_list/pick_list.json
@@ -18,6 +18,8 @@
"get_item_locations",
"section_break_6",
"scan_barcode",
+ "column_break_13",
+ "scan_mode",
"section_break_15",
"locations",
"amended_from",
@@ -138,11 +140,22 @@
"fieldtype": "Data",
"label": "Scan Barcode",
"options": "Barcode"
+ },
+ {
+ "fieldname": "column_break_13",
+ "fieldtype": "Column Break"
+ },
+ {
+ "default": "0",
+ "description": "If checked, picked qty won't automatically be fulfilled on submit of pick list.",
+ "fieldname": "scan_mode",
+ "fieldtype": "Check",
+ "label": "Scan Mode"
}
],
"is_submittable": 1,
"links": [],
- "modified": "2022-04-29 13:45:24.401314",
+ "modified": "2022-05-04 11:12:48.044239",
"modified_by": "Administrator",
"module": "Stock",
"name": "Pick List",
diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py
index ce3ec60..d2e266f 100644
--- a/erpnext/stock/doctype/pick_list/pick_list.py
+++ b/erpnext/stock/doctype/pick_list/pick_list.py
@@ -41,14 +41,16 @@
def before_submit(self):
update_sales_orders = set()
for item in self.locations:
- # if the user has not entered any picked qty, set it to stock_qty, before submit
- if item.picked_qty < item.stock_qty:
+ if self.scan_mode and item.picked_qty < item.stock_qty:
frappe.throw(
_("Row {0} is short by {1} {2}").format(
item.idx, item.stock_qty - item.picked_qty, item.stock_uom
),
title=_("Pick List Incomplete"),
)
+ elif not self.scan_mode and item.picked_qty == 0:
+ # if the user has not entered any picked qty, set it to stock_qty, before submit
+ item.picked_qty = item.stock_qty
if item.sales_order_item:
# update the picked_qty in SO Item