Cannot Delete Asset because Purchase Invoice is Linked to it

I am using ERPNext for my startup and it is doing great! Before 1 Month I have upgrade my ERPNext to v10.1.28 from the previous version.

After that i cannot able to cancel the wrongly made Asset Entries which i have made before the Upgrade. If i am trying to cancel Asset it is asking to purchase invoice and If i am trying to cancel the Purchase Invoice, it is asking to cancel the Asset.

Both the entries are linked to each other and doesn’t allow me to cancel each other. I appreciate your help to get rid of this issue.


@rohit_w @shreya115 this is a general use-case,… users often get into the loop by creating custom link fields, linked with one-to-one transaction.

Any update on this? I am facing the same issue.

any solution yet? I’m facing the same issue

The same problem here. Any fix for the bug?

i faced same problem, kindly share any update regarding this issue.

@umair So the problem is how to delete a cycle or circular reference ? Has Frappe reviewed what to do in this case or is there say a github issue or feature request note for this, for folks to upvote or implement a tool here?

Hello… Do we have update on this?? at least we need a walk-around to fix our current problem…

You have options here, including -

Post the issue Issues · frappe/erpnext · GitHub for upvoting so all can get a sense of the need.

With sql delete the offensive objects from the database. Do this on a non-production test environment since you do not want to break the integrity of the database.

Engage someone to devise a tool, document the general process they used and so on. The idea is to contribute so all can benefit and learn.

I am facing the same issue

@karthik8592 @Vinit @Jacksoneasyway @Muha @ahmad_Faiaz @Ahmad @FredericVerville
I think frappe team didn’t solve the one-to-one delete issue yet,
I solved the issue temporarily by deleting the records from SQL command,

1. Open the database >> bench --site yoursiteName mariaDB
2. Change the safe update mode to false >> SET SQL_SAFE_UPDATES=0;
3. Delete the records >> delete from tabAsset where ...

I had a similar problem where I was not able to cancel a Purchase Receipt because it was assigned to an Asset and couldn’t delete the Asset because it was assigned to a Purchase Receipt.

I ended up going to the database and fixing things manually. I’m not sure how this would affect the DB integrity but could not find a way around it through ERPNext interface.

Please fix this issue as the functionality is basic and should be available to users.

These are the SQL commands I had to run to remove the Purchase Receipt, the Asset and related General Ledger entries:
DELETE FROM tabPurchase Receipt WHERE name=‘MAT-PRE-2019-00001’;
DELETE FROM tabPurchase Receipt Item WHERE name=‘658ba5a34d’;
DELETE FROM tabGL Entry WHERE voucher_no=‘MAT-PRE-2019-00001’;
DELETE FROM tabAsset WHERE name=‘ACC-ASS-2019-00001’;
UPDATE tabItem SET last_purchase_rate=0.000000 WHERE name=‘TOSH-POR’;

Where should I write these commands and how? Can you please explain step by step.

Wow. At least 10 people have/had the same problem.
3 years passed. And still the same basic bug (V.13.7.1)…

How can I solve this issue on Frappe Cloud where I don’t have direct access to the database?

1 Like

Any solution of this issue as I’m using
ERPNext: v13.18.0 (version-13)
Frappe Framework: v13.18.0 (version-13)

1 Like

i have same problem … a couple year and not solution…