mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +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):
|
def cancel_depreciation_entries(self):
|
||||||
for d in self.get("depreciation_schedule"):
|
for d in self.get("depreciation_schedule"):
|
||||||
if d.journal_entry:
|
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(
|
frappe.throw(
|
||||||
_(
|
_(
|
||||||
"Cannot cancel Asset Depreciation Schedule {0} as it has a draft journal entry {1}."
|
"Cannot cancel Asset Depreciation Schedule {0} as it has a draft journal entry {1}."
|
||||||
|
|||||||
Reference in New Issue
Block a user