diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index aec094b0cd51..08a24472576d 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -44,8 +44,10 @@ def update_packing_list_item(doc, packing_item_code, qty, main_item_row, descrip # check if exists exists = 0 for d in doc.get("packed_items"): - if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code and\ - d.parent_detail_docname == main_item_row.name: + if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code: + if d.parent_detail_docname != main_item_row.name: + d.parent_detail_docname = main_item_row.name + pi, exists = d, 1 break