Merge pull request #53219 from frappe/mergify/bp/version-16-hotfix/pr-53218

fix: HRMS test cases failing due to validation in item (backport #53218)
This commit is contained in:
rohitwaghchaure
2026-03-06 18:51:07 +05:30
committed by GitHub

View File

@@ -218,7 +218,6 @@ class Item(Document):
self.validate_auto_reorder_enabled_in_stock_settings()
self.cant_change()
self.validate_item_tax_net_rate_range()
self.validate_allow_to_set_serial_batch()
if not self.is_new():
self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group")
@@ -227,18 +226,6 @@ class Item(Document):
self.update_variants()
self.update_item_price()
def validate_allow_to_set_serial_batch(self):
if not self.has_serial_no and not self.has_batch_no:
return
if not frappe.db.get_single_value("Stock Settings", "enable_serial_and_batch_no_for_item"):
frappe.throw(
_(
"Please check the 'Enable Serial and Batch No for Item' checkbox in the {0} to set Serial No or Batch No for the item."
).format(get_link_to_form("Stock Settings", "Stock Settings")),
title=_("Serial and Batch No for Item Disabled"),
)
def validate_description(self):
"""Clean HTML description if set"""
if (