From b9ccbd50b4427600f42ed9d471b00ff28fdac8d9 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 7 Mar 2022 22:31:42 +0530 Subject: [PATCH 1/2] fix: Ambigous column in picklist query (cherry picked from commit 517fbf1d1f0a7d44e817b3f22ae30142e7bdf4c8) --- erpnext/stock/doctype/pick_list/pick_list.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index b7987543f2b..86f24c2427c 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -273,9 +273,9 @@ def get_available_item_locations_for_batched_item(item_code, from_warehouses, re and IFNULL(batch.`expiry_date`, '2200-01-01') > %(today)s {warehouse_condition} GROUP BY - `warehouse`, - `batch_no`, - `item_code` + sle.`warehouse`, + sle.`batch_no`, + sle.`item_code` HAVING `qty` > 0 ORDER BY IFNULL(batch.`expiry_date`, '2200-01-01'), batch.`creation` """.format(warehouse_condition=warehouse_condition), { #nosec From 95792d8f32fbed533e7603b02968b356aff70120 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 8 Mar 2022 07:56:20 +0530 Subject: [PATCH 2/2] fix: Remove unintentional changes (cherry picked from commit d9d4c2ce792304a528a7b8a27d50259a04bdd7ca) --- erpnext/stock/doctype/pick_list/pick_list.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index 86f24c2427c..b2eaecb5868 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -9,7 +9,6 @@ from frappe import _ from frappe.model.document import Document from frappe.model.mapper import map_child_doc from frappe.utils import cint, floor, flt, today -from six import iteritems from erpnext.selling.doctype.sales_order.sales_order import ( make_delivery_note as create_delivery_note_from_sales_order, @@ -246,7 +245,7 @@ def get_available_item_locations_for_serialized_item(item_code, from_warehouses, warehouse_serial_nos_map.setdefault(warehouse, []).append(serial_no) locations = [] - for warehouse, serial_nos in iteritems(warehouse_serial_nos_map): + for warehouse, serial_nos in warehouse_serial_nos_map.items(): locations.append({ 'qty': len(serial_nos), 'warehouse': warehouse,