We have a bit of a peculiar situation. We had a list of Assets created on ERPNext but noticed after a while that there were errors. We eventually had to cancel and delete the Journal Entries that were auto created from the Asset master. In fact, I recall we even deleted all company transactions
The issue however is that it appears the Asset docs somehow kept some kind of invisible link to the Journal Entries. The accountants have gone on to create other Journal Entries for regular book-keeping but those that were created using the previously deleted IDs are now somehow linked to the Assets even though they arenāt depreciation entries
Trying to cancel any of such Journals gives the error below:
āCannot delete or cancel because Journal Entry JV-00XXX is linked with Asset HHXXXā
This is really strange as inspecting the Journal Entries show no visible link to any Assets. Even if they were actually linked to Assets, we should still be able to Cancel them!
Any suggestions on how to solve this issue would be greatly appreciated
Hey @wale,
If you can isolate this to Asset creation, I think youāve found a bug. Other journal entries are working just fine?
Can you provide more (anonymous-ized) details about your Asset workflow? At minimum it makes sense to take your problem and turn it into a test.
Our Assets werenāt created with any special workflow. Just entered the details and selected the āCalculate Depreciationā option so that the system auto creates the schedule and corresponding Journal Entries when theyāre due
Yes, other Journal Entries can be cancelled normally. The issue is with the ones that have previously deleted IDs
We need a way to remove the hidden links between the Assets and these Journal Entriesā¦
Yes, all the previously deleted Journal Entries are still listed in the Depreciation Schedule table - including those with IDs that havenāt yet been taken up by new Journal Entries! When I click on the ones without existing Journals, I get the āSorry! I could not find what you were looking forā error
The Journal Entries child table shows no links to the Assets when expanded; the Reference section (where linked Assets/Doctypes are usually shown) is empty. Something odd however is that when I click on the āLinksā option from the Menu dropdown, it shows the Asset!
Still hoping for some suggestions hereā¦ I need a way to remove/refresh the links between the Assets and Journal Entries from the backend since itās obvious thereās an issue from the UI
Never mindā¦ it just occured to me I could do this directly in the db rather than programmatically. I cleared the links to Journal Entries from the Depreciation Schedule table and now Iām deleting the Asset records. The Journal Entries themselves didnāt need to be deleted since they didnāt actually belong to the Assets in the first place