mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-15 02:33:38 +00:00
@@ -3449,19 +3449,19 @@ def move_sample_to_retention_warehouse(company, items):
|
||||
|
||||
sabe = next(item for item in sabb.entries if item.batch_no == batch_no)
|
||||
if sample_quantity:
|
||||
total_qty += sample_quantity
|
||||
if sabb.has_serial_no:
|
||||
sabe_list.extend(
|
||||
[
|
||||
entry
|
||||
for entry in sabb.entries
|
||||
if entry.batch_no == batch_no
|
||||
and frappe.db.exists(
|
||||
"Serial No", {"name": entry.serial_no, "warehouse": warehouse}
|
||||
)
|
||||
][: int(sample_quantity)]
|
||||
)
|
||||
new_sabe = [
|
||||
entry
|
||||
for entry in sabb.entries
|
||||
if entry.batch_no == batch_no
|
||||
and frappe.db.exists(
|
||||
"Serial No", {"name": entry.serial_no, "warehouse": warehouse}
|
||||
)
|
||||
][: int(sample_quantity)]
|
||||
sabe_list.extend(new_sabe)
|
||||
total_qty += len(new_sabe)
|
||||
else:
|
||||
total_qty += sample_quantity
|
||||
sabe.qty = sample_quantity
|
||||
else:
|
||||
sabb.entries.remove(sabe)
|
||||
|
||||
@@ -2291,7 +2291,7 @@ class TestStockEntry(IntegrationTestCase):
|
||||
"retain_sample": 1,
|
||||
"sample_quantity": 2,
|
||||
"has_batch_no": 1,
|
||||
"has_seral_no": 1,
|
||||
"has_serial_no": 1,
|
||||
"create_new_batch": 1,
|
||||
"batch_number_series": "SAMPLE-RET-.#####",
|
||||
"serial_no_series": "SAMPLE-RET-SN-.#####",
|
||||
|
||||
Reference in New Issue
Block a user