Patch for Production Order Track Operation
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index f3282f7..e9e3f2d 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -171,4 +171,5 @@
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 0000000..0a12142
--- /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