[webform][attachments] allow saving filename, insert file path later
This commit is contained in:
parent
78d061ced5
commit
9f04cfc968
1 changed files with 5 additions and 2 deletions
|
|
@ -380,7 +380,8 @@ def accept(web_form, data, for_payment=False):
|
|||
if df and df.fieldtype in ('Attach', 'Attach Image'):
|
||||
if value and 'data:' and 'base64' in value:
|
||||
files.append((fieldname, value))
|
||||
doc.set(fieldname, '')
|
||||
if not doc.name:
|
||||
doc.set(fieldname, '')
|
||||
continue
|
||||
|
||||
elif not value and doc.get(fieldname):
|
||||
|
|
@ -404,7 +405,9 @@ def accept(web_form, data, for_payment=False):
|
|||
if web_form.login_required and frappe.session.user=="Guest":
|
||||
frappe.throw(_("You must login to submit this form"))
|
||||
|
||||
doc.insert(ignore_permissions = True, ignore_mandatory = True if files else False)
|
||||
ignore_mandatory = True if files else False
|
||||
|
||||
doc.insert(ignore_permissions = True, ignore_mandatory = ignore_mandatory)
|
||||
|
||||
# add files
|
||||
if files:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue