fix: do not auto reserve serial/batch if SRE already has serial/batch set

This commit is contained in:
Mihir Kandoi
2025-08-13 12:24:44 +05:30
parent 8290731253
commit ac9b0409f5

View File

@@ -256,7 +256,7 @@ class StockReservationEntry(Document):
and (self.get("_action") == "submit")
and (self.has_serial_no or self.has_batch_no)
and frappe.get_single_value("Stock Settings", "auto_reserve_serial_and_batch")
and not self.get("bypass_auto_reserve_serial_and_batch")
and not self.sb_entries
):
from erpnext.stock.doctype.batch.batch import get_available_batches
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos_for_outward