From b8ecefa06ca87848a8689a9060c08e33bb65db55 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 30 Dec 2025 10:51:28 +0530 Subject: [PATCH] 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):