Merge pull request #7406 from saurabh6790/terms_and_cond_fix

[fix] if terms exists then only call render_template
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index c092695..d7dce92 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -2212,7 +2212,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
    "in_list_view": 0, 
-   "in_standard_filter": 0, 
+   "in_standard_filter": 1, 
    "label": "Status", 
    "length": 0, 
    "no_copy": 1, 
@@ -2360,7 +2360,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 1, 
-   "in_standard_filter": 1, 
+   "in_standard_filter": 0, 
    "label": "% Billed", 
    "length": 0, 
    "no_copy": 1, 
@@ -3062,7 +3062,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-11-07 06:01:00.233621", 
+ "modified": "2017-01-06 12:51:56.556331", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Purchase Order", 
diff --git a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py
index f627b4a..44e247e 100644
--- a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py
+++ b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py
@@ -3,6 +3,7 @@
 
 from __future__ import unicode_literals
 from erpnext.setup.utils import get_exchange_rate
+from frappe.utils import flt, cint
 import frappe
 
 def execute(filters=None):
@@ -20,6 +21,7 @@
 		price_data = []
 		suppliers = []
 		company_currency = frappe.db.get_default("currency")
+		float_precision = cint(frappe.db.get_default("float_precision")) or 2 
 		# Get the list of suppliers
 		for root in frappe.db.sql("""select parent, qty, rate from `tabSupplier Quotation Item` where item_code=%s and docstatus < 2""", item, as_dict=1):
 			for splr in frappe.db.sql("""SELECT supplier from `tabSupplier Quotation` where name =%s and docstatus < 2""", root.parent, as_dict=1):
@@ -46,7 +48,7 @@
 				# Get the quantity for this row
 				for item_price in price_data:
 					if str(item_price.qty) == col.key and item_price.supplier == root:
-						row[col.key] = item_price.rate * exchange_rate
+						row[col.key] = flt(item_price.rate * exchange_rate, float_precision)
 						row[col.key + "QUOTE"] = item_price.parent
 						break
 					else:
diff --git a/erpnext/patches/v5_0/portal_fixes.py b/erpnext/patches/v5_0/portal_fixes.py
index d7e3b44..260222e 100644
--- a/erpnext/patches/v5_0/portal_fixes.py
+++ b/erpnext/patches/v5_0/portal_fixes.py
@@ -2,5 +2,5 @@
 import erpnext.setup.install
 
 def execute():
-	frappe.reload_doc("website", "doctype", "web_form_field", force=True)
+	frappe.reload_doc("website", "doctype", "web_form_field", force=True, reset_permissions=True)
 	#erpnext.setup.install.add_web_forms()
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index f171007..51e68fb 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -2580,7 +2580,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
-   "in_standard_filter": 0, 
+   "in_standard_filter": 1, 
    "label": "Delivery Status", 
    "length": 0, 
    "no_copy": 1, 
@@ -2610,7 +2610,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
    "in_list_view": 1, 
-   "in_standard_filter": 1, 
+   "in_standard_filter": 0, 
    "label": "%  Delivered", 
    "length": 0, 
    "no_copy": 1, 
@@ -2668,7 +2668,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
    "in_list_view": 1, 
-   "in_standard_filter": 1, 
+   "in_standard_filter": 0, 
    "label": "% Amount Billed", 
    "length": 0, 
    "no_copy": 1, 
@@ -2698,7 +2698,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
-   "in_standard_filter": 0, 
+   "in_standard_filter": 1, 
    "label": "Billing Status", 
    "length": 0, 
    "no_copy": 1, 
@@ -3369,7 +3369,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-11-16 04:06:28.675876", 
+ "modified": "2017-01-06 12:51:17.847227", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Sales Order", 
@@ -3383,7 +3383,7 @@
    "delete": 1, 
    "email": 1, 
    "export": 0, 
-   "if_owner": 1, 
+   "if_owner": 0, 
    "import": 0, 
    "is_custom": 0, 
    "permlevel": 0, 
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index 8272977..6be4ad8 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -2705,7 +2705,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
    "in_list_view": 0, 
-   "in_standard_filter": 0, 
+   "in_standard_filter": 1, 
    "label": "Status", 
    "length": 0, 
    "no_copy": 1, 
@@ -3120,7 +3120,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-12-16 03:56:08.745185", 
+ "modified": "2017-01-06 12:52:48.960308", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Delivery Note", 
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 0ed6952..9b944fa 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -143,7 +143,7 @@
 	user_default_warehouse = user_default_warehouse_list[0] \
 		if len(user_default_warehouse_list)==1 else ""
 
-	warehouse = user_default_warehouse or args.warehouse or item.default_warehouse
+	warehouse = user_default_warehouse or item.default_warehouse or args.warehouse
 
 	out = frappe._dict({
 		"item_code": item.name,