From 8e3cd1ab31c56f22919d9d902a405a18f0bf4884 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 23 Jan 2022 17:04:55 +0530 Subject: [PATCH] fix: Don't delete barcode while saving Item (#29411) (#29417) (cherry picked from commit 096e7b9ec5e3b67983cfa3a06335fba435f88c97) Co-authored-by: Britlog --- erpnext/stock/doctype/item/item.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 281e8818759..d99fadca46e 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -602,14 +602,6 @@ class Item(WebsiteGenerator): frappe.throw(_("Barcode {0} is not a valid {1} code").format( item_barcode.barcode, item_barcode.barcode_type), InvalidBarcode) - if item_barcode.barcode != item_barcode.name: - # if barcode is getting updated , the row name has to reset. - # Delete previous old row doc and re-enter row as if new to reset name in db. - item_barcode.set("__islocal", True) - item_barcode_entry_name = item_barcode.name - item_barcode.name = None - frappe.delete_doc("Item Barcode", item_barcode_entry_name) - def validate_warehouse_for_reorder(self): '''Validate Reorder level table for duplicate and conditional mandatory''' warehouse = []