mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
perf: don't validate for change on new documents
This commit is contained in:
@@ -306,7 +306,7 @@ class Item(Document):
|
|||||||
if self.stock_ledger_created():
|
if self.stock_ledger_created():
|
||||||
frappe.throw(_("Cannot be a fixed asset item as Stock Ledger is 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)
|
asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1)
|
||||||
if asset:
|
if asset:
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
|
|||||||
Reference in New Issue
Block a user