doctype dropdown rectify, validate series is set (#13305)
This commit is contained in:
parent
8a8966ce9b
commit
c5b061834b
@ -20,7 +20,7 @@ class NamingSeries(Document):
|
|||||||
+ frappe.db.sql_list("""select dt from `tabCustom Field`
|
+ frappe.db.sql_list("""select dt from `tabCustom Field`
|
||||||
where fieldname='naming_series'""")))
|
where fieldname='naming_series'""")))
|
||||||
|
|
||||||
doctypes = list(set(get_doctypes_with_read()) | set(doctypes))
|
doctypes = list(set(get_doctypes_with_read()).intersection(set(doctypes)))
|
||||||
prefixes = ""
|
prefixes = ""
|
||||||
for d in doctypes:
|
for d in doctypes:
|
||||||
options = ""
|
options = ""
|
||||||
@ -47,6 +47,7 @@ class NamingSeries(Document):
|
|||||||
|
|
||||||
def update_series(self, arg=None):
|
def update_series(self, arg=None):
|
||||||
"""update series list"""
|
"""update series list"""
|
||||||
|
self.validate_series_set()
|
||||||
self.check_duplicate()
|
self.check_duplicate()
|
||||||
series_list = self.set_options.split("\n")
|
series_list = self.set_options.split("\n")
|
||||||
|
|
||||||
@ -60,6 +61,10 @@ class NamingSeries(Document):
|
|||||||
|
|
||||||
return self.get_transactions()
|
return self.get_transactions()
|
||||||
|
|
||||||
|
def validate_series_set(self):
|
||||||
|
if self.select_doc_for_series and not self.set_options:
|
||||||
|
frappe.throw(_("Please set the series to be used."))
|
||||||
|
|
||||||
def set_series_for(self, doctype, ol):
|
def set_series_for(self, doctype, ol):
|
||||||
options = self.scrub_options_list(ol)
|
options = self.scrub_options_list(ol)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user