fix: remove already transferred batch

(cherry picked from commit b54067e04d)
This commit is contained in:
Mihir Kandoi
2026-01-12 18:56:14 +05:30
committed by Mergify
parent d9326d80de
commit f1e41f4a4f

View File

@@ -3443,10 +3443,12 @@ def move_sample_to_retention_warehouse(company, items):
batch_no,
)
sabe = next(item for item in sabb.entries if item.batch_no == batch_no)
if sample_quantity:
total_qty += sample_quantity
sabe = next(item for item in sabb.entries if item.batch_no == batch_no)
sabe.qty = -1 * sample_quantity
else:
sabb.entries.remove(sabe)
if total_qty:
sabb.save()