From 80cea9795ecc20dd0c61e943e4ae937d5878df3e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 13 Dec 2016 14:50:20 +0530 Subject: [PATCH 1/3] Address naming if multiple address for same type --- erpnext/utilities/doctype/address/address.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/utilities/doctype/address/address.py b/erpnext/utilities/doctype/address/address.py index 1d215cc0e7..2952531f01 100644 --- a/erpnext/utilities/doctype/address/address.py +++ b/erpnext/utilities/doctype/address/address.py @@ -10,6 +10,7 @@ from frappe.utils import cstr 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 @@ class Address(Document): 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.")) From 39712b5e1d0d36de0ecd93b3300462609fa5a84c Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 14 Dec 2016 14:12:20 +0530 Subject: [PATCH 2/3] [Fix] Pricing rule issue --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index b36898a807..3b3184c92b 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -126,7 +126,7 @@ def get_pricing_rule_for_item(args): }) 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 From 673d43cc8ef9c88621742406c4c31eb607eebd0c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 14 Dec 2016 15:03:06 +0600 Subject: [PATCH 3/3] bumped to version 7.1.25 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index e88e00d9fc..6c935254a0 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'''