fix: don't make naming series mandatory for items
Item variants are an exception, hence this needs to be checked conditionally.
This commit is contained in:
parent
2eccb7a1ca
commit
7fcaeca403
@ -180,11 +180,11 @@ class NamingSeries(Document):
|
||||
prefix = parse_naming_series(parts)
|
||||
return prefix
|
||||
|
||||
def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True):
|
||||
def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True, make_mandatory=1):
|
||||
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
|
||||
if naming_series:
|
||||
make_property_setter(doctype, "naming_series", "hidden", 0, "Check", validate_fields_for_doctype=False)
|
||||
make_property_setter(doctype, "naming_series", "reqd", 1, "Check", validate_fields_for_doctype=False)
|
||||
make_property_setter(doctype, "naming_series", "reqd", make_mandatory, "Check", validate_fields_for_doctype=False)
|
||||
|
||||
# set values for mandatory
|
||||
try:
|
||||
|
@ -20,7 +20,7 @@ class StockSettings(Document):
|
||||
|
||||
from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
|
||||
set_by_naming_series("Item", "item_code",
|
||||
self.get("item_naming_by")=="Naming Series", hide_name_field=True)
|
||||
self.get("item_naming_by")=="Naming Series", hide_name_field=True, make_mandatory=0)
|
||||
|
||||
stock_frozen_limit = 356
|
||||
submitted_stock_frozen = self.stock_frozen_upto_days or 0
|
||||
|
Loading…
Reference in New Issue
Block a user