From bd7c00c59e78f73c621e3a97efbed818e204a8ff Mon Sep 17 00:00:00 2001 From: joezsweet Date: Fri, 16 Feb 2018 10:17:10 +0100 Subject: [PATCH] [Hot Fix] barcode_type auto set to a wrong value (#12957) * Fix barcode_type auto set to a wrong value This fix a problem that arise, for some weird reason that i can't figure out, when the barcode length == 8, 9,10 or 12,13 and barcode_type is not set; barcode_type become "ean8, ean9, ean10, ean11, ean12, ean13" * codacy fix --- erpnext/stock/doctype/item/item.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 9758b93672..4b97fa3d44 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -490,6 +490,7 @@ class Item(WebsiteGenerator): frappe.throw(_("Barcode {0} already used in Item {1}").format( item_barcode.barcode, duplicate[0][0])) + item_barcode.barcode_type = "" if item_barcode.barcode_type not in ["EAN", "UPC-A"] else item_barcode.barcode_type if item_barcode.barcode_type: if not ean.is_valid(item_barcode.barcode): frappe.throw(_("Barcode {0} is not a valid {1} code").format(