Skip to content

Commit

Permalink
fix: Asset cancelation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
khushi8112 committed May 14, 2024
1 parent e3f5393 commit fa2b6c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion erpnext/accounts/doctype/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,12 @@ def unlink_advance_entry_reference(self):

def unlink_asset_reference(self):
for d in self.get("accounts"):
root_type = frappe.get_value("Account", d.account, "root_type")
if (
self.voucher_type == "Depreciation Entry"
and d.reference_type == "Asset"
and d.reference_name
and d.account_type == "Depreciation"
and root_type == "Expense"
and d.debit
):
asset = frappe.get_doc("Asset", d.reference_name)
Expand Down

0 comments on commit fa2b6c4

Please sign in to comment.