From 8677cd15655deb42ed883b63b30dd8db324d938e Mon Sep 17 00:00:00 2001 From: Vishal Dhayagude Date: Thu, 30 Nov 2017 13:52:30 +0530 Subject: [PATCH] [patch] Patch added to rename net_weight field (#11798) --- erpnext/patches.txt | 1 + erpnext/patches/v9_2/rename_net_weight_in_item_master.py | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 erpnext/patches/v9_2/rename_net_weight_in_item_master.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index a2efa82647..54f4dfd13f 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -474,3 +474,4 @@ erpnext.patches.v9_2.repost_reserved_qty_for_production erpnext.patches.v9_2.remove_company_from_patient erpnext.patches.v9_2.set_item_name_in_production_order erpnext.patches.v10_0.update_lft_rgt_for_employee +erpnext.patches.v9_2.rename_net_weight_in_item_master diff --git a/erpnext/patches/v9_2/rename_net_weight_in_item_master.py b/erpnext/patches/v9_2/rename_net_weight_in_item_master.py new file mode 100644 index 0000000000..cad979deab --- /dev/null +++ b/erpnext/patches/v9_2/rename_net_weight_in_item_master.py @@ -0,0 +1,8 @@ +from __future__ import unicode_literals +import frappe +from frappe.model.utils.rename_field import rename_field + +def execute(): + frappe.reload_doc("stock", "doctype", "item") + if frappe.db.has_column('Item', 'net_weight'): + rename_field("Item", "net_weight", "weight_per_unit")