fix: circular dependency during asset cancellation (#18952)

This commit is contained in:
rohitwaghchaure
2019-09-06 18:39:25 +05:30
committed by Nabin Hait
parent 8c9fd62775
commit 690139ca11

View File

@@ -286,12 +286,6 @@ class Asset(AccountsController):
if self.status not in ("Submitted", "Partially Depreciated", "Fully Depreciated"):
frappe.throw(_("Asset cannot be cancelled, as it is already {0}").format(self.status))
if self.purchase_invoice:
frappe.throw(_("Please cancel Purchase Invoice {0} first").format(self.purchase_invoice))
if self.purchase_receipt:
frappe.throw(_("Please cancel Purchase Receipt {0} first").format(self.purchase_receipt))
def delete_depreciation_entries(self):
for d in self.get("schedules"):
if d.journal_entry: