fix: Only add Item to packed_items list if it's not already there

This commit is contained in:
GangaManoj 2021-08-27 19:59:20 +05:30
parent 08188f2ac7
commit a7be02fe32

View File

@ -39,8 +39,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