Merge branch 'master' into develop
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index e88e00d..6c93525 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
 from __future__ import unicode_literals
 import frappe
 
-__version__ = '7.1.24'
+__version__ = '7.1.25'
 
 def get_default_company(user=None):
 	'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 3a41851..9928227 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -138,7 +138,7 @@
 	})
 	
 	if args.ignore_pricing_rule or not args.item_code:
-		if args.name and args.get("pricing_rule"):
+		if frappe.db.exists(args.doctype, args.name) and args.get("pricing_rule"):
 			item_details = remove_pricing_rule(args, item_details)
 		return item_details
 
diff --git a/erpnext/utilities/doctype/address/address.py b/erpnext/utilities/doctype/address/address.py
index 1d215cc..2952531 100644
--- a/erpnext/utilities/doctype/address/address.py
+++ b/erpnext/utilities/doctype/address/address.py
@@ -10,6 +10,7 @@
 from frappe.model.document import Document
 from jinja2 import TemplateSyntaxError
 from frappe.utils.user import is_website_user
+from frappe.model.naming import make_autoname
 
 class Address(Document):
 	def __setup__(self):
@@ -21,7 +22,10 @@
 				or self.supplier or self.sales_partner or self.lead
 
 		if self.address_title:
-			self.name = cstr(self.address_title).strip() + "-" + cstr(self.address_type).strip()
+			self.name = (cstr(self.address_title).strip() + "-" + cstr(self.address_type).strip())
+			if frappe.db.exists("Address", self.name):
+				self.name = make_autoname(cstr(self.address_title).strip() + "-" + 
+					cstr(self.address_type).strip() + "-.#")
 		else:
 			throw(_("Address Title is mandatory."))