Skip to content

Commit

Permalink
fix: remove item-item group name validation (#28392)
Browse files Browse the repository at this point in the history
(cherry picked from commit 043e325)
  • Loading branch information
Alchez authored and mergify-bot committed Nov 15, 2021
1 parent c1a1e9c commit 3e69f51
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions erpnext/setup/doctype/item_group/item_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def validate(self):
def on_update(self):
NestedSet.on_update(self)
invalidate_cache_for(self)
self.validate_name_with_item()
self.validate_one_root()
self.delete_child_item_groups_key()

Expand All @@ -65,10 +64,6 @@ def on_trash(self):
WebsiteGenerator.on_trash(self)
self.delete_child_item_groups_key()

def validate_name_with_item(self):
if frappe.db.exists("Item", self.name):
frappe.throw(frappe._("An item exists with same name ({0}), please change the item group name or rename the item").format(self.name), frappe.NameError)

def get_context(self, context):
context.show_search = True
context.body_class = "product-page"
Expand Down
7 changes: 0 additions & 7 deletions erpnext/stock/doctype/item/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def validate(self):

def on_update(self):
invalidate_cache_for_item(self)
self.validate_name_with_item_group()
self.update_variants()
self.update_item_price()
self.update_website_item()
Expand Down Expand Up @@ -377,12 +376,6 @@ def stock_ledger_created(self):
where item_code = %s and is_cancelled = 0 limit 1""", self.name))
return self._stock_ledger_created

def validate_name_with_item_group(self):
# causes problem with tree build
if frappe.db.exists("Item Group", self.name):
frappe.throw(
_("An Item Group exists with same name, please change the item name or rename the item group"))

def update_item_price(self):
frappe.db.sql("""
UPDATE `tabItem Price`
Expand Down

0 comments on commit 3e69f51

Please sign in to comment.