mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-17 00:18:39 +00:00
fix(item): add server-side guard for serial/batch items in make_opening_stock_entry
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1601,6 +1601,10 @@ def make_opening_stock_entry(
|
||||
|
||||
if not item.is_stock_item:
|
||||
frappe.throw(_("Opening Stock can only be set for stock items."))
|
||||
if item.has_serial_no or item.has_batch_no:
|
||||
frappe.throw(
|
||||
_("Opening Stock for serialised or batch items must be set via the Stock Reconciliation form.")
|
||||
)
|
||||
if item.stock_ledger_created():
|
||||
frappe.throw(
|
||||
_("Opening Stock cannot be created as stock transactions already exist for item {0}.").format(
|
||||
|
||||
Reference in New Issue
Block a user