mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-12 17:23:38 +00:00
Merge pull request #51177 from aerele/fix/disassemble-serial-and-batch-bundle
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user