How to permanently delete an item?

I have added few items which i want to delete, what options to I have to permanently delete an item and start over. As an example when I try to delete and item with SKU code “Y0-NHTG-LD2J” I get the below error Cannot delete or cancel because Item Y0-NHTG-LD2J is linked with Stock Ledger Entry MAT-SLE-2022-00007 In the “Stock Ledger Entry” I have canceled the stock but still can’t delete the item, what options do I have?

delete the stock ledger

How do you delete a stock ledger?
I have already landed on the " Stock Ledger Entry" page and when selecting the ledger want to delete i don’t see a button delete.

@Usama_Qasem stock ledger entries are immutable . you won’t be able to delete the entry or the item. do you have access to the bench terminal ?

I am new to this, so I don’t even know what a bench terminal is, how do I locate it?
This is a single user operations as of now, I am the sole administrator

@Usama_Qasem the terminal where you do "bench migrate " and other commands

Please follow the below steps

  1. Go to Accounts Settings
  2. Check “Delete Accounting and Stock Ledger Entries on deletion of Transaction”.
  3. Then try again to delete the Item related transactional entries.

Kind Regards,

Rafiqul Hassan (Noman)

1 Like

I tried that, still giving the same error as before

It worked, i had to first delete the stock entry, not the ledger, then delete the item. Thank you for your help.


yes sir i have can you please guide me throught it please for the above issue.

@Shyam_Sundar1 open console use frappe.db.delete to delete all stock entries related to that item . then delete the item

1 Like

Hi, how did you delete the stock entry? I’m checking my Stock Entry list, it was not there (I deleted all my transactions of the company).