From 43cdca950f4d00efe05486140807c49158b582bf Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 30 Dec 2025 10:48:04 +0530 Subject: [PATCH 1/3] fix: type in barcode type --- erpnext/stock/doctype/item_barcode/item_barcode.json | 7 ++++--- erpnext/stock/doctype/item_barcode/item_barcode.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/doctype/item_barcode/item_barcode.json b/erpnext/stock/doctype/item_barcode/item_barcode.json index 513f7123e61..1b2166a6f44 100644 --- a/erpnext/stock/doctype/item_barcode/item_barcode.json +++ b/erpnext/stock/doctype/item_barcode/item_barcode.json @@ -25,7 +25,7 @@ "fieldtype": "Select", "in_list_view": 1, "label": "Barcode Type", - "options": "\nEAN\nUPC-A\nCODE-39\nEAN-12\nEAN-8\nGS1\nGTIN\nISBN\nISBN-10\nISBN-13\nISSN\nJAN\nPZN\nUPC" + "options": "\nEAN\nUPC-A\nCODE-39\nEAN-13\nEAN-8\nGS1\nGTIN\nISBN\nISBN-10\nISBN-13\nISSN\nJAN\nPZN\nUPC" }, { "fieldname": "uom", @@ -37,15 +37,16 @@ ], "istable": 1, "links": [], - "modified": "2024-03-27 13:09:54.217164", + "modified": "2025-12-30 10:47:29.560663", "modified_by": "Administrator", "module": "Stock", "name": "Item Barcode", "naming_rule": "Random", "owner": "Administrator", "permissions": [], + "row_format": "Dynamic", "sort_field": "creation", "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} diff --git a/erpnext/stock/doctype/item_barcode/item_barcode.py b/erpnext/stock/doctype/item_barcode/item_barcode.py index e38b95bad5f..bc8e8c8214f 100644 --- a/erpnext/stock/doctype/item_barcode/item_barcode.py +++ b/erpnext/stock/doctype/item_barcode/item_barcode.py @@ -20,7 +20,7 @@ class ItemBarcode(Document): "EAN", "UPC-A", "CODE-39", - "EAN-12", + "EAN-13", "EAN-8", "GS1", "GTIN", From b8ecefa06ca87848a8689a9060c08e33bb65db55 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 30 Dec 2025 10:51:28 +0530 Subject: [PATCH 2/3] fix: add missing patch --- erpnext/patches.txt | 2 +- erpnext/patches/v16_0/fix_barcode_typo.py | 7 +++++++ erpnext/stock/doctype/item/item.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v16_0/fix_barcode_typo.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 44ecb5b20cc..ce466bc94cd 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -455,4 +455,4 @@ erpnext.patches.v16_0.set_mr_picked_qty erpnext.patches.v16_0.update_tax_withholding_field_in_payment_entry erpnext.patches.v16_0.migrate_tax_withholding_data erpnext.patches.v16_0.update_corrected_cancelled_status - +erpnext.patches.v16_0.fix_barcode_typo diff --git a/erpnext/patches/v16_0/fix_barcode_typo.py b/erpnext/patches/v16_0/fix_barcode_typo.py new file mode 100644 index 00000000000..0433b96bf6a --- /dev/null +++ b/erpnext/patches/v16_0/fix_barcode_typo.py @@ -0,0 +1,7 @@ +import frappe + + +def execute(): + frappe.qb.update("Item Barcode").set("barcode_type", "EAN-13").where( + frappe.qb.Field("barcode_type") == "EAN-12" + ).run() diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index b26644d12d6..5c92fecbfdf 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -484,7 +484,7 @@ class Item(Document): ) if item_barcode.barcode_type: barcode_type = convert_erpnext_to_barcodenumber( - item_barcode.barcode_type.upper(), item_barcode.barcode + item_barcode.barcode_type.replace("-", "").upper(), item_barcode.barcode ) if barcode_type in barcodenumber.barcodes(): if not barcodenumber.check_code(barcode_type, item_barcode.barcode): From 1097d6eef1b8cee5201c677bdbbc3fc6d54ca458 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 30 Dec 2025 12:25:34 +0530 Subject: [PATCH 3/3] fix: add missing GTIN-14 barcode --- erpnext/stock/doctype/item_barcode/item_barcode.json | 4 ++-- erpnext/stock/doctype/item_barcode/item_barcode.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/item_barcode/item_barcode.json b/erpnext/stock/doctype/item_barcode/item_barcode.json index 1b2166a6f44..66fcc524443 100644 --- a/erpnext/stock/doctype/item_barcode/item_barcode.json +++ b/erpnext/stock/doctype/item_barcode/item_barcode.json @@ -25,7 +25,7 @@ "fieldtype": "Select", "in_list_view": 1, "label": "Barcode Type", - "options": "\nEAN\nUPC-A\nCODE-39\nEAN-13\nEAN-8\nGS1\nGTIN\nISBN\nISBN-10\nISBN-13\nISSN\nJAN\nPZN\nUPC" + "options": "\nEAN\nUPC-A\nCODE-39\nEAN-13\nEAN-8\nGS1\nGTIN\nGTIN-14\nISBN\nISBN-10\nISBN-13\nISSN\nJAN\nPZN\nUPC" }, { "fieldname": "uom", @@ -37,7 +37,7 @@ ], "istable": 1, "links": [], - "modified": "2025-12-30 10:47:29.560663", + "modified": "2025-12-30 12:24:11.749128", "modified_by": "Administrator", "module": "Stock", "name": "Item Barcode", diff --git a/erpnext/stock/doctype/item_barcode/item_barcode.py b/erpnext/stock/doctype/item_barcode/item_barcode.py index bc8e8c8214f..43764722c88 100644 --- a/erpnext/stock/doctype/item_barcode/item_barcode.py +++ b/erpnext/stock/doctype/item_barcode/item_barcode.py @@ -24,6 +24,7 @@ class ItemBarcode(Document): "EAN-8", "GS1", "GTIN", + "GTIN-14", "ISBN", "ISBN-10", "ISBN-13",