fix: validate sabb autocreation when disabled

This commit is contained in:
Kavin
2025-11-12 11:32:41 +05:30
parent 4bd476293b
commit 3ca1940881
2 changed files with 4 additions and 2 deletions

View File

@@ -1213,7 +1213,9 @@ class StockEntry(StockController, SubcontractingInwardController):
).update_serial_and_batch_entries(
serial_nos=serial_nos.get(row.name), batch_nos=batch_nos.get(row.name)
)
elif not row.serial_and_batch_bundle:
elif not row.serial_and_batch_bundle and frappe.get_single_value(
"Stock Settings", "auto_create_serial_and_batch_bundle_for_outward"
):
bundle_doc = SerialBatchCreation(
{
"item_code": row.item_code,

View File

@@ -268,7 +268,7 @@ class SerialBatchBundle:
and not self.sle.serial_and_batch_bundle
and self.item_details.has_batch_no == 1
and (
self.item_details.create_new_batch
(self.item_details.create_new_batch and self.sle.actual_qty > 0)
or (
frappe.get_single_value(
"Stock Settings", "auto_create_serial_and_batch_bundle_for_outward"