Ignore validate while making property setter to preserve naming series
This commit is contained in:
parent
a9a31f9a86
commit
c46ea4614e
2 changed files with 4 additions and 3 deletions
|
|
@ -133,9 +133,9 @@ class DocType(Document):
|
|||
"property": "options", "field_name": "naming_series"})
|
||||
|
||||
if not existing_property_setter:
|
||||
make_property_setter(self.name, "naming_series", "options", naming_series[0].options, "Text")
|
||||
make_property_setter(self.name, "naming_series", "options", naming_series[0].options, "Text", ignore_validate=True)
|
||||
if naming_series[0].default:
|
||||
make_property_setter(self.name, "naming_series", "default", naming_series[0].default, "Text")
|
||||
make_property_setter(self.name, "naming_series", "default", naming_series[0].default, "Text", ignore_validate=True)
|
||||
|
||||
def export_doc(self):
|
||||
from frappe.modules.export_file import export_to_files
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class PropertySetter(Document):
|
|||
from frappe.core.doctype.doctype.doctype import validate_fields_for_doctype
|
||||
validate_fields_for_doctype(self.doc_type)
|
||||
|
||||
def make_property_setter(doctype, fieldname, property, value, property_type, for_doctype = False):
|
||||
def make_property_setter(doctype, fieldname, property, value, property_type, for_doctype = False, ignore_validate=False):
|
||||
# WARNING: Ignores Permissions
|
||||
property_setter = frappe.get_doc({
|
||||
"doctype":"Property Setter",
|
||||
|
|
@ -66,5 +66,6 @@ def make_property_setter(doctype, fieldname, property, value, property_type, for
|
|||
"property_type": property_type
|
||||
})
|
||||
property_setter.ignore_permissions = True
|
||||
property_setter.ignore_validate = ignore_validate
|
||||
property_setter.insert()
|
||||
return property_setter
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue