Reload doctype bewfore renaming margin fields (#8771)

diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index b28ef22..8907cf3 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -393,4 +393,4 @@
 erpnext.patches.v8_0.revert_manufacturers_table_from_item
 erpnext.patches.v8_0.disable_instructor_role
 erpnext.patches.v8_0.merge_student_batch_and_student_group
-erpnext.patches.v8_0.rename_total_margin_to_rate_with_margin
\ No newline at end of file
+erpnext.patches.v8_0.rename_total_margin_to_rate_with_margin # 11-05-2017
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py b/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py
index a324751..3fc477e 100644
--- a/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py
+++ b/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py
@@ -12,7 +12,7 @@
 
 	for d in ("Sales Order Item", "Sales Invoice Item",
 		"Delivery Note Item", "Quotation Item"):
-
+		frappe.reload_doctype(d)
 		rename_field_if_exists(d, "total_margin", "rate_with_margin")