mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 21:22:42 +01:00
Merge pull request #53218 from rohitwaghchaure/fixed-item-creation-in-test-cases
fix: HRMS test cases failing due to validation in item
This commit is contained in:
@@ -231,7 +231,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")
|
||||
@@ -240,18 +239,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 (
|
||||
|
||||
Reference in New Issue
Block a user