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): diff --git a/erpnext/stock/doctype/item_barcode/item_barcode.json b/erpnext/stock/doctype/item_barcode/item_barcode.json index 513f7123e61..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-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\nGTIN-14\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 12:24:11.749128", "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..43764722c88 100644 --- a/erpnext/stock/doctype/item_barcode/item_barcode.py +++ b/erpnext/stock/doctype/item_barcode/item_barcode.py @@ -20,10 +20,11 @@ class ItemBarcode(Document): "EAN", "UPC-A", "CODE-39", - "EAN-12", + "EAN-13", "EAN-8", "GS1", "GTIN", + "GTIN-14", "ISBN", "ISBN-10", "ISBN-13",