From e4c659386a8ad8c687acc65db25e4ed861ab167e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 16 Dec 2014 15:16:40 +0530 Subject: [PATCH] packing list index --- erpnext/stock/doctype/packed_item/packed_item.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 9263907da1..4ce940cbc0 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -27,7 +27,7 @@ def get_bin_qty(item, warehouse): where item_code = %s and warehouse = %s""", (item, warehouse), as_dict = 1) return det and det[0] or '' -def update_packing_list_item(obj, packing_item_code, qty, warehouse, line, packing_list_idx): +def update_packing_list_item(obj, packing_item_code, qty, warehouse, line): bin = get_bin_qty(packing_item_code, warehouse) item = get_packing_item_details(packing_item_code) @@ -54,9 +54,7 @@ def update_packing_list_item(obj, packing_item_code, qty, warehouse, line, packi pi.warehouse = warehouse if not pi.batch_no: pi.batch_no = cstr(line.get("batch_no")) - pi.idx = packing_list_idx - packing_list_idx += 1 def make_packing_list(obj, item_table_fieldname): @@ -64,13 +62,11 @@ def make_packing_list(obj, item_table_fieldname): if obj.get("_action") and obj._action == "update_after_submit": return - packing_list_idx = 0 parent_items = [] for d in obj.get(item_table_fieldname): if frappe.db.get_value("Sales BOM", {"new_item_code": d.item_code}): for i in get_sales_bom_items(d.item_code): - update_packing_list_item(obj, i['item_code'], flt(i['qty'])*flt(d.qty), - d.warehouse, d, packing_list_idx) + update_packing_list_item(obj, i['item_code'], flt(i['qty'])*flt(d.qty), d.warehouse, d) if [d.item_code, d.name] not in parent_items: parent_items.append([d.item_code, d.name])