fix: check for auto reserve serial/batch before auto reserving

This commit is contained in:
Mihir Kandoi
2025-08-12 16:51:06 +05:30
parent 81c8972a66
commit 2c64b76392

View File

@@ -255,6 +255,8 @@ class StockReservationEntry(Document):
not self.from_voucher_type
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")
):
from erpnext.stock.doctype.batch.batch import get_available_batches
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos_for_outward