Merge pull request #4513 from nabinhait/discount_percentage
Additional Discount amount based on percentage
diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py
index 5c6aecd..cc6157f 100644
--- a/erpnext/accounts/doctype/account/account.py
+++ b/erpnext/accounts/doctype/account/account.py
@@ -199,6 +199,10 @@
if val != [self.is_group, self.root_type, self.company]:
throw(_("""Merging is only possible if following properties are same in both records. Is Group, Root Type, Company"""))
+
+ if self.is_group and frappe.db.get_value("Account", new, "parent_account") == old:
+ frappe.db.set_value("Account", new, "parent_account",
+ frappe.db.get_value("Account", old, "parent_account"))
return new_account
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 0fc0faa..dfe17e8 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -541,7 +541,8 @@
if self.variant_of:
template_uom = frappe.db.get_value("Item", self.variant_of, "stock_uom")
if template_uom != self.stock_uom:
- frappe.throw(_("Default Unit of Measure for Variant must be same as Template"))
+ frappe.throw(_("Default Unit of Measure for Variant '{0}' must be same as in Template '{1}'")
+ .format(self.stock_uom, template_uom))
def validate_attributes(self):
if self.has_variants or self.variant_of: