fix: Set fieldname when attaching to field

This commit is contained in:
Faris Ansari 2020-08-21 13:30:20 +05:30
parent 2cfbe95c68
commit eb87e6b773
3 changed files with 10 additions and 0 deletions

View file

@ -144,6 +144,9 @@ export default {
docname: {
default: null
},
fieldname: {
default: null
},
folder: {
default: 'Home'
},
@ -406,6 +409,10 @@ export default {
form_data.append('docname', this.docname);
}
if (this.fieldname) {
form_data.append('fieldname', this.fieldname);
}
if (this.method) {
form_data.append('method', this.method);
}

View file

@ -7,6 +7,7 @@ export default class FileUploader {
on_success,
doctype,
docname,
fieldname,
files,
folder,
restrictions,
@ -28,6 +29,7 @@ export default class FileUploader {
show_upload_button: !Boolean(this.dialog),
doctype,
docname,
fieldname,
method,
folder,
on_success,

View file

@ -66,6 +66,7 @@ frappe.ui.form.ControlAttach = frappe.ui.form.ControlData.extend({
if (this.frm) {
options.doctype = this.frm.doctype;
options.docname = this.frm.docname;
options.fieldname = this.df.fieldname;
}
if (this.df.options) {