[Fix] Bin not deleted on delete of an item (#13539)

This commit is contained in:
rohitwaghchaure 2018-04-06 10:29:07 +05:30 committed by Rushabh Mehta
parent aa7cddef5c
commit 22d9f0a4aa

View File

@ -506,7 +506,7 @@ class Item(WebsiteGenerator):
def on_trash(self):
super(Item, self).on_trash()
frappe.db.sql("""delete from tabBin where item_code=%s""", self.item_code)
frappe.db.sql("""delete from tabBin where item_code=%s""", self.name)
frappe.db.sql("delete from `tabItem Price` where item_code=%s", self.name)
for variant_of in frappe.get_all("Item", filters={"variant_of": self.name}):
frappe.delete_doc("Item", variant_of.name)