Merge branch 'develop'
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index d298d3c..1a2000a 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1,2 +1,2 @@
 from __future__ import unicode_literals
-__version__ = '6.7.1'
+__version__ = '6.7.2'
diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py
index bfeeb34..4afce91 100644
--- a/erpnext/accounts/report/gross_profit/gross_profit.py
+++ b/erpnext/accounts/report/gross_profit/gross_profit.py
@@ -98,11 +98,17 @@
 
 			row.base_amount = flt(row.base_net_amount)
 
-			product_bundles = self.product_bundles.get(row.parenttype, {}).get(row.parent, frappe._dict())
-
+			if row.update_stock:
+				product_bundles = self.product_bundles.get(row.parenttype, {}).get(row.parent, frappe._dict())
+			elif row.dn_detail:
+				product_bundles = self.product_bundles.get("Delivery Note", {})\
+					.get(row.delivery_note, frappe._dict())
+				row.item_row = row.dn_detail
+			
 			# get buying amount
 			if row.item_code in product_bundles:
-				row.buying_amount = self.get_buying_amount_from_product_bundle(row, product_bundles[row.item_code])
+				row.buying_amount = self.get_buying_amount_from_product_bundle(row, 
+					product_bundles[row.item_code])
 			else:
 				row.buying_amount = self.get_buying_amount(row, row.item_code)
 
@@ -142,7 +148,6 @@
 					new_row.qty += row.qty
 					new_row.buying_amount += row.buying_amount
 					new_row.base_amount += row.base_amount
-					# new_row.allocated_amount += (row.allocated_amount or 0) if new_row.allocated_amount else 0
 
 			new_row.gross_profit = new_row.base_amount - new_row.buying_amount
 			new_row.gross_profit_percent = ((new_row.gross_profit / new_row.base_amount) * 100.0) \
@@ -158,9 +163,9 @@
 
 	def get_buying_amount_from_product_bundle(self, row, product_bundle):
 		buying_amount = 0.0
-		for bom_item in product_bundle:
-			if bom_item.get("parent_detail_docname")==row.item_row:
-				buying_amount += self.get_buying_amount(row, bom_item.item_code)
+		for packed_item in product_bundle:
+			if packed_item.get("parent_detail_docname")==row.item_row:
+				buying_amount += self.get_buying_amount(row, packed_item.item_code)
 
 		return buying_amount
 
@@ -176,14 +181,14 @@
 		else:
 			my_sle = self.sle.get((item_code, row.warehouse))
 			if (row.update_stock or row.dn_detail) and my_sle:
-				parenttype, parent, item_row = row.parenttype, row.parent, row.item_row
+				parenttype, parent = row.parenttype, row.parent
 				if row.dn_detail:
-					parenttype, parent, item_row = "Delivery Note", row.delivery_note, row.dn_detail
+					parenttype, parent = "Delivery Note", row.delivery_note
 				
 				for i, sle in enumerate(my_sle):
 					# find the stock valution rate from stock ledger entry
 					if sle.voucher_type == parenttype and parent == sle.voucher_no and \
-						sle.voucher_detail_no == item_row:
+						sle.voucher_detail_no == row.item_row:
 							previous_stock_value = len(my_sle) > i+1 and \
 								flt(my_sle[i+1].stock_value) or 0.0
 							return  previous_stock_value - flt(sle.stock_value)
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 2552d19..86ff9c8 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -29,7 +29,7 @@
 """
 app_icon = "icon-th"
 app_color = "#e74c3c"
-app_version = "6.7.1"
+app_version = "6.7.2"
 source_link = "https://github.com/frappe/erpnext"
 
 error_report_email = "support@erpnext.com"
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index c40eec5..3ad735a 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -230,3 +230,4 @@
 erpnext.patches.v6_4.fix_expense_included_in_valuation
 execute:frappe.delete_doc_if_exists("Report", "Item-wise Last Purchase Rate")
 erpnext.patches.v6_6.fix_website_image
+erpnext.patches.v6_6.remove_fiscal_year_from_leave_allocation
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 93f9266..feb0213 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -78,11 +78,6 @@
 			frm.set_value("description", frm.doc.item_code);
 	},
 
-	tax_type: function(frm, cdt, cdn){
-		var d = locals[cdt][cdn];
-		return get_server_fields('get_tax_rate', d.tax_type, 'taxes', doc, cdt, cdn, 1);
-	},
-
 	copy_from_item_group: function(frm) {
 		return frm.call({
 			doc: frm.doc,
@@ -315,3 +310,4 @@
 cur_frm.add_fetch('attribute', 'from_range', 'from_range');
 cur_frm.add_fetch('attribute', 'to_range', 'to_range');
 cur_frm.add_fetch('attribute', 'increment', 'increment');
+cur_frm.add_fetch('tax_type', 'tax_rate', 'tax_rate');
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 168d999..a795de8 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -398,9 +398,6 @@
 			item_description=%s, modified=NOW() where item_code=%s""",
 			(self.item_name, self.description, self.name))
 
-	def get_tax_rate(self, tax_type):
-		return { "tax_rate": frappe.db.get_value("Account", tax_type, "tax_rate") }
-
 	def on_trash(self):
 		super(Item, self).on_trash()
 		frappe.db.sql("""delete from tabBin where item_code=%s""", self.item_code)
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index 3a1f508..0efc8bc 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -143,22 +143,23 @@
 	make_purchase_order: function() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+			run_link_triggers: true
+		});
 	},
 
 	make_supplier_quotation: function() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation",
 			frm: cur_frm
-		})
+		});
 	},
 
 	make_stock_entry: function() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry",
 			frm: cur_frm
-		})
+		});
 	}
 });
 
diff --git a/setup.py b/setup.py
index f795a66..0150873 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = "6.7.1"
+version = "6.7.2"
 
 with open("requirements.txt", "r") as f:
 	install_requires = f.readlines()