From 59c76707139c35b2556afb0b7ac6e52f16731bc6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 8 Jun 2012 12:31:37 +0530 Subject: [PATCH] copy uom in pur inv from po, pr --- erpnext/patches/june_2012/copy_uom_for_pur_inv_item.py | 4 ++++ erpnext/patches/patch_list.py | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 erpnext/patches/june_2012/copy_uom_for_pur_inv_item.py diff --git a/erpnext/patches/june_2012/copy_uom_for_pur_inv_item.py b/erpnext/patches/june_2012/copy_uom_for_pur_inv_item.py new file mode 100644 index 0000000000..d3127170a4 --- /dev/null +++ b/erpnext/patches/june_2012/copy_uom_for_pur_inv_item.py @@ -0,0 +1,4 @@ +def execute(): + import webnotes + webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Order Item` t2 set t1.uom = t2.uom where ifnull(t1.po_detail, '') != '' and t1.po_detail = t2.name") + webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Receipt Item` t2 set t1.uom = t2.uom where ifnull(t1.pr_detail, '') != '' and t1.pr_detail = t2.name") \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 86f35d3ef7..96bf161197 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -417,4 +417,9 @@ patch_list = [ 'patch_file': 'barcode_in_feature_setup', 'description': 'Track item by barcode' }, + { + 'patch_module': 'patches.june_2012', + 'patch_file': 'copy_uom_for_pur_inv_item', + 'description': 'Copy uom for pur inv item from PO and PR item table' + }, ] \ No newline at end of file