fix(item): fix patch for barcode childtable migration in item (#18069)

* fix(item): fix patch for barcode childtable migration in item

(cherry picked from commit b2c43ee2d91599038f7bdf2038bbc4c4e7b36285)

* fix(item): fixing broken patch item_barcode_childtable_migrate

(cherry picked from commit beca677276e0b5b143cd6d1d08efa8529663f60c)
This commit is contained in:
Karthikeyan S 2019-06-28 12:46:42 +05:30 committed by Nabin Hait
parent 9dd7d3ebb3
commit e6236094a6
2 changed files with 4 additions and 2 deletions

View File

@ -594,7 +594,7 @@ erpnext.patches.v11_1.make_job_card_time_logs
erpnext.patches.v12_0.rename_pricing_rule_child_doctypes
erpnext.patches.v12_0.move_target_distribution_from_parent_to_child
erpnext.patches.v12_0.stock_entry_enhancements
erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019
erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019 #25-06-2019
erpnext.patches.v12_0.move_item_tax_to_item_tax_template
erpnext.patches.v11_1.set_variant_based_on
erpnext.patches.v11_1.woocommerce_set_creation_user

View File

@ -8,8 +8,10 @@ import frappe
def execute():
frappe.reload_doc("stock", "doctype", "item_barcode")
if frappe.get_all("Item Barcode", limit=1): return
if "barcode" not in frappe.db.get_table_columns("Item"): return
items_barcode = frappe.get_all('Item', ['name', 'barcode'], { 'barcode': ('!=', '') })
items_barcode = frappe.db.sql("select name, barcode from tabItem where barcode is not null", as_dict=True)
frappe.reload_doc("stock", "doctype", "item")