fix: web form allow incomplete feature not working
This commit is contained in:
parent
491cfbd374
commit
00c3cd69a4
1 changed files with 5 additions and 1 deletions
|
|
@ -641,6 +641,10 @@ def accept(web_form, data):
|
|||
# insert
|
||||
doc = frappe.new_doc(doctype)
|
||||
|
||||
# Set ignore_mandatory flag if allow_incomplete is enabled
|
||||
if web_form.allow_incomplete:
|
||||
doc.flags.ignore_mandatory = True
|
||||
|
||||
# set values
|
||||
for field in web_form.web_form_fields:
|
||||
fieldname = field.fieldname
|
||||
|
|
@ -671,7 +675,7 @@ def accept(web_form, data):
|
|||
if web_form.login_required and frappe.session.user == "Guest":
|
||||
frappe.throw(_("You must login to submit this form"))
|
||||
|
||||
ignore_mandatory = True if files else False
|
||||
ignore_mandatory = True if (files or web_form.allow_incomplete) else False
|
||||
|
||||
doc.insert(ignore_permissions=True, ignore_mandatory=ignore_mandatory)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue