Merge pull request #51177 from aerele/fix/disassemble-serial-and-batch-bundle

This commit is contained in:
Mihir Kandoi
2025-12-23 21:07:32 +05:30
committed by GitHub

View File

@@ -1070,13 +1070,23 @@ class SerialBatchCreation:
for d in remove_list:
package.remove(d)
def make_serial_and_batch_bundle(self):
def make_serial_and_batch_bundle(
self, serial_nos=None, batch_nos=None
): # passing None instead of [] due to ruff linter error B006
serial_nos = serial_nos or []
batch_nos = batch_nos or []
doc = frappe.new_doc("Serial and Batch Bundle")
valid_columns = doc.meta.get_valid_columns()
for key, value in self.__dict__.items():
if key in valid_columns:
doc.set(key, value)
if serial_nos:
self.serial_nos = serial_nos
if batch_nos:
self.batches = batch_nos
if self.type_of_transaction == "Outward":
self.set_auto_serial_batch_entries_for_outward()
elif self.type_of_transaction == "Inward":