fix: remove validate_name_in_customer function

(cherry picked from commit 2b32d3644f)
This commit is contained in:
RitvikSardana
2024-04-16 12:20:16 +05:30
committed by Mergify
parent 704452a9fa
commit 6bff9d39e3

View File

@@ -71,14 +71,9 @@ class CustomerGroup(NestedSet):
) )
def on_update(self): def on_update(self):
self.validate_name_with_customer()
super().on_update() super().on_update()
self.validate_one_root() self.validate_one_root()
def validate_name_with_customer(self):
if frappe.db.exists("Customer", self.name):
frappe.msgprint(_("A customer with the same name already exists"), raise_exception=1)
def get_parent_customer_groups(customer_group): def get_parent_customer_groups(customer_group):
lft, rgt = frappe.db.get_value("Customer Group", customer_group, ["lft", "rgt"]) lft, rgt = frappe.db.get_value("Customer Group", customer_group, ["lft", "rgt"])