fix: Only add Item to packed_items list if it's not already there
This commit is contained in:
parent
08188f2ac7
commit
a7be02fe32
@ -39,8 +39,10 @@ def update_packing_list_item(doc, packing_item_code, qty, main_item_row, descrip
|
|||||||
# check if exists
|
# check if exists
|
||||||
exists = 0
|
exists = 0
|
||||||
for d in doc.get("packed_items"):
|
for d in doc.get("packed_items"):
|
||||||
if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code and\
|
if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code:
|
||||||
d.parent_detail_docname == main_item_row.name:
|
if d.parent_detail_docname != main_item_row.name:
|
||||||
|
d.parent_detail_docname = main_item_row.name
|
||||||
|
|
||||||
pi, exists = d, 1
|
pi, exists = d, 1
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user