Merge pull request #7520 from RobertSchouten/heatmap_limit_dev

[fix] accounts heatmaps now covering 366 days not 20
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.json b/erpnext/manufacturing/doctype/production_order/production_order.json
index dd8bb5b..04a3a93 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.json
+++ b/erpnext/manufacturing/doctype/production_order/production_order.json
@@ -374,7 +374,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "description": "Warehouse for reserving items", 
+   "description": "", 
    "fieldname": "source_warehouse", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -383,7 +383,7 @@
    "in_filter": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Source Warehouse", 
+   "label": "Source Warehouse (for reserving Items)", 
    "length": 0, 
    "no_copy": 0, 
    "options": "Warehouse", 
@@ -1244,7 +1244,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-11-07 05:13:02.064821", 
+ "modified": "2017-01-12 05:32:52.523006", 
  "modified_by": "Administrator", 
  "module": "Manufacturing", 
  "name": "Production Order", 
@@ -1298,5 +1298,6 @@
  "read_only_onload": 0, 
  "sort_order": "ASC", 
  "title_field": "production_item", 
+ "track_changes": 0, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py
index ac8815d..0d74d23 100644
--- a/erpnext/selling/doctype/customer/test_customer.py
+++ b/erpnext/selling/doctype/customer/test_customer.py
@@ -27,11 +27,6 @@
 	def test_party_details(self):
 		from erpnext.accounts.party import get_party_details
 
-		frappe.db.sql('delete from tabContact')
-		frappe.db.sql('delete from tabAddress')
-		frappe.db.sql('delete from `tabDynamic Link`')
-
-
 		to_check = {
 			'selling_price_list': None,
 			'customer_group': '_Test Customer Group',
diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py
index dfe3ec0..cc69403 100644
--- a/erpnext/setup/doctype/naming_series/naming_series.py
+++ b/erpnext/setup/doctype/naming_series/naming_series.py
@@ -8,17 +8,19 @@
 from frappe import msgprint, throw, _
 
 from frappe.model.document import Document
+from frappe.permissions import get_doctypes_with_read
 
 class NamingSeriesNotSetError(frappe.ValidationError): pass
 
 class NamingSeries(Document):
 	def get_transactions(self, arg=None):
 		doctypes = list(set(frappe.db.sql_list("""select parent
-				from `tabDocField` df where fieldname='naming_series' and 
-				exists(select * from `tabDocPerm` dp, `tabRole` role where dp.role = role.name and dp.parent = df.parent and not role.disabled)""")
+				from `tabDocField` df where fieldname='naming_series'""")
 			+ frappe.db.sql_list("""select dt from `tabCustom Field`
 				where fieldname='naming_series'""")))
 
+		doctypes = list(set(get_doctypes_with_read()) | set(doctypes))
+
 		prefixes = ""
 		for d in doctypes:
 			options = ""
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index a51f6f3..b427b94 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -160,6 +160,7 @@
 	return doc
 
 def _get_cart_quotation(party=None):
+	'''Return the open Quotation of type "Shopping Cart" or make a new one'''
 	if not party:
 		party = get_party()
 
diff --git a/erpnext/tests/utils.py b/erpnext/tests/utils.py
index 8d24f5e..7024b0d 100644
--- a/erpnext/tests/utils.py
+++ b/erpnext/tests/utils.py
@@ -6,28 +6,31 @@
 import frappe
 
 def create_test_contact_and_address():
-	if not frappe.db.exists('Address', '_Test Address for Customer-Office'):
-		frappe.get_doc(dict(
-			doctype='Address',
-			address_title='_Test Address for Customer',
-			address_type='Office',
-			address_line1='Station Road',
-			city='Mumbai',
-			country='India',
-			links = [dict(
-				link_doctype='Customer',
-				link_name='_Test Customer'
-			)]
-		)).insert()
+	frappe.db.sql('delete from tabContact')
+	frappe.db.sql('delete from tabAddress')
+	frappe.db.sql('delete from `tabDynamic Link`')
 
-	if not frappe.db.exists('Contact', '_Test Contact for _Test Customer-_Test Customer'):
-		frappe.get_doc(dict(
-			doctype='Contact',
-			email_id='test_contact_customer@example.com',
-			phone='+91 0000000000',
-			first_name='_Test Contact for _Test Customer',
-			links = [dict(
-				link_doctype='Customer',
-				link_name='_Test Customer'
-			)]
-		)).insert()
+	frappe.get_doc(dict(
+		doctype='Address',
+		address_title='_Test Address for Customer',
+		address_type='Office',
+		address_line1='Station Road',
+		city='_Test City',
+		state='Test State',
+		country='India',
+		links = [dict(
+			link_doctype='Customer',
+			link_name='_Test Customer'
+		)]
+	)).insert()
+
+	frappe.get_doc(dict(
+		doctype='Contact',
+		email_id='test_contact_customer@example.com',
+		phone='+91 0000000000',
+		first_name='_Test Contact for _Test Customer',
+		links = [dict(
+			link_doctype='Customer',
+			link_name='_Test Customer'
+		)]
+	)).insert()