Skip to content

Commit

Permalink
Merge pull request #43431 from frappe/mergify/bp/version-15/pr-43429
Browse files Browse the repository at this point in the history
fix: Data missing in table: None, MandatoryError (backport #43422) (backport #43429)
  • Loading branch information
rohitwaghchaure authored Sep 29, 2024
2 parents e706aa6 + 2c4610c commit 8b5997e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions erpnext/stock/doctype/stock_entry/stock_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3148,11 +3148,13 @@ def get_available_materials(work_order) -> dict:

if 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:
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

Expand Down Expand Up @@ -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():
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


Expand Down

0 comments on commit 8b5997e

Please sign in to comment.