瀏覽代碼

Don't validate fields for doctype for custom fields when called from customize form

version-14
Nabin Hait 10 年之前
父節點
當前提交
0987bdd849
共有 2 個檔案被更改,包括 6 行新增5 行删除
  1. +5
    -5
      frappe/core/doctype/custom_field/custom_field.py
  2. +1
    -0
      frappe/core/doctype/customize_form/customize_form.py

+ 5
- 5
frappe/core/doctype/custom_field/custom_field.py 查看文件

@@ -3,7 +3,7 @@


from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe.utils import cint, cstr
from frappe.utils import cstr
from frappe import _ from frappe import _


from frappe.model.document import Document from frappe.model.document import Document
@@ -30,12 +30,12 @@ class CustomField(Document):
frappe.throw(_("Fieldname not set for Custom Field")) frappe.throw(_("Fieldname not set for Custom Field"))


def on_update(self): def on_update(self):
# validate field
from frappe.core.doctype.doctype.doctype import validate_fields_for_doctype

frappe.clear_cache(doctype=self.dt) frappe.clear_cache(doctype=self.dt)


validate_fields_for_doctype(self.dt)
if not self.ignore_validate:
# validate field
from frappe.core.doctype.doctype.doctype import validate_fields_for_doctype
validate_fields_for_doctype(self.dt)


# create property setter to emulate insert after # create property setter to emulate insert after
self.create_property_setter() self.create_property_setter()


+ 1
- 0
frappe/core/doctype/customize_form/customize_form.py 查看文件

@@ -167,6 +167,7 @@ class CustomizeForm(Document):
changed = True changed = True


if changed: if changed:
custom_field.ignore_validate = True
custom_field.save() custom_field.save()


def delete_custom_fields(self): def delete_custom_fields(self):


Loading…
取消
儲存