mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-13 20:05:09 +00:00
chore: fetch docstatus to validate
(cherry picked from commit d6fb99916e)
This commit is contained in:
@@ -128,7 +128,8 @@ class AssetDepreciationSchedule(Document):
|
||||
def cancel_depreciation_entries(self):
|
||||
for d in self.get("depreciation_schedule"):
|
||||
if d.journal_entry:
|
||||
if d.journal_entry == "Draft":
|
||||
je_status = frappe.db.get_value("Journal Entry", d.journal_entry, "docstatus")
|
||||
if je_status == 0:
|
||||
frappe.throw(
|
||||
_(
|
||||
"Cannot cancel Asset Depreciation Schedule {0} as it has a draft journal entry {1}."
|
||||
|
||||
Reference in New Issue
Block a user