From cc08c681533646983f2af11bba2c1fb20a72d1de Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Mon, 13 Jul 2015 12:35:20 +0530 Subject: [PATCH] Patch for Production Order Track Operation --- erpnext/patches.txt | 3 ++- erpnext/patches/v5_1/track_operations.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/v5_1/track_operations.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index f3282f7354..e9e3f2d673 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -171,4 +171,5 @@ execute:frappe.db.sql("""delete from `tabProject Task`""") erpnext.patches.v5_0.item_variants erpnext.patches.v5_0.update_item_desc_in_invoice erpnext.patches.v5_1.fix_against_account -erpnext.patches.v5_1.fix_credit_days_based_on \ No newline at end of file +erpnext.patches.v5_1.fix_credit_days_based_on +erpnext.patches.v5_1.track_operations \ No newline at end of file diff --git a/erpnext/patches/v5_1/track_operations.py b/erpnext/patches/v5_1/track_operations.py new file mode 100644 index 0000000000..0a121420e5 --- /dev/null +++ b/erpnext/patches/v5_1/track_operations.py @@ -0,0 +1,8 @@ +from __future__ import unicode_literals + +import frappe + +def execute(): + frappe.reload_doctype("Production Order") + frappe.db.sql("""Update `tabProduction Order` as po set track_operations=1 where + exists(select name from `tabProduction Order Operation` as po_operation where po_operation.parent = po.name )""") \ No newline at end of file