mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-26 14:41:42 +01:00
fix: Data missing in table: None, MandatoryError (#43422) (cherry picked from commit8e33e0e1d2) Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com> (cherry picked from commit4b3f143f83)
This commit is contained in:
@@ -3148,11 +3148,13 @@ def get_available_materials(work_order) -> dict:
|
|||||||
|
|
||||||
if row.serial_no:
|
if row.serial_no:
|
||||||
for serial_no in get_serial_nos(row.serial_no):
|
for serial_no in get_serial_nos(row.serial_no):
|
||||||
item_data.serial_nos.remove(serial_no)
|
if serial_no in item_data.serial_nos:
|
||||||
|
item_data.serial_nos.remove(serial_no)
|
||||||
|
|
||||||
elif row.serial_nos:
|
elif row.serial_nos:
|
||||||
for serial_no in get_serial_nos(row.serial_nos):
|
for serial_no in get_serial_nos(row.serial_nos):
|
||||||
item_data.serial_nos.remove(serial_no)
|
if serial_no in item_data.serial_nos:
|
||||||
|
item_data.serial_nos.remove(serial_no)
|
||||||
|
|
||||||
return available_materials
|
return available_materials
|
||||||
|
|
||||||
@@ -3270,6 +3272,9 @@ def create_serial_and_batch_bundle(parent_doc, row, child, type_of_transaction=N
|
|||||||
for batch_no, qty in row.batches_to_be_consume.items():
|
for batch_no, qty in row.batches_to_be_consume.items():
|
||||||
doc.append("entries", {"batch_no": batch_no, "warehouse": row.warehouse, "qty": qty * -1})
|
doc.append("entries", {"batch_no": batch_no, "warehouse": row.warehouse, "qty": qty * -1})
|
||||||
|
|
||||||
|
if not doc.entries:
|
||||||
|
return None
|
||||||
|
|
||||||
return doc.insert(ignore_permissions=True).name
|
return doc.insert(ignore_permissions=True).name
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user