Skip to content

Commit

Permalink
style: code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
khushi8112 committed May 14, 2024
1 parent fa2b6c4 commit e843683
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions erpnext/accounts/doctype/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,11 @@ 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 root_type == "Expense"
and frappe.get_cached_value("Account", d.account, "root_type") == "Expense"
and d.debit
):
asset = frappe.get_doc("Asset", d.reference_name)
Expand Down

0 comments on commit e843683

Please sign in to comment.