ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Cannot Delete Journal Entry


#1

Hi ,

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

Thanks plenty


#2

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.


#3

Hi @tmatteson

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…

Thanks


#4

Check if they are linked via the Dynamic Link Tables just the way how Customer/Supplier are linked to Contacts and Addresses


#5

Hi @root13F

Could you pls explain how to do that?

Thanks a lot


#6

Check the Customize Form view of Asset. Is there some hidden Table


#7

Hi @root13F

I’ve checked… No hidden table there. Just the Depreciation Schedule table

This is quite strange. Any other ideas what could be happening?


#8

Does this link to some Journal Entry ?

Also do the Journal Entries child table linked to those Assets ? Expand the rows and check


#9

Hi @root13F

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!

???


#10

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

Thanks


#11

If someone could suggest how to delete the content of a column in a doctype table from the backend, I think I could handle the rest from there…

Thanks


#13

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

Many thanks all!


#14