perf: don't validate for change on new documents

This commit is contained in:
Ankush Menat
2025-05-26 14:59:02 +05:30
parent a54d965d6d
commit 31b8eb4922

View File

@@ -306,7 +306,7 @@ class Item(Document):
if self.stock_ledger_created():
frappe.throw(_("Cannot be a fixed asset item as Stock Ledger is created."))
if not self.is_fixed_asset:
if not self.is_fixed_asset and not self.is_new():
asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1)
if asset:
frappe.throw(