fix: incorrect attachment limit message (#17848)
This commit is contained in:
parent
3ec4a618e3
commit
a01967c182
1 changed files with 7 additions and 4 deletions
|
|
@ -160,6 +160,12 @@ frappe.ui.form.Attachments = class Attachments {
|
|||
this.dialog.$wrapper.remove();
|
||||
}
|
||||
|
||||
const restrictions = {};
|
||||
if (this.frm.meta.max_attachments) {
|
||||
restrictions.max_number_of_files =
|
||||
this.frm.meta.max_attachments - this.frm.attachments.get_attachments().length;
|
||||
}
|
||||
|
||||
new frappe.ui.FileUploader({
|
||||
doctype: this.frm.doctype,
|
||||
docname: this.frm.docname,
|
||||
|
|
@ -168,10 +174,7 @@ frappe.ui.form.Attachments = class Attachments {
|
|||
on_success: (file_doc) => {
|
||||
this.attachment_uploaded(file_doc);
|
||||
},
|
||||
restrictions: {
|
||||
max_number_of_files:
|
||||
this.frm.meta.max_attachments - this.frm.attachments.get_attachments().length,
|
||||
},
|
||||
restrictions,
|
||||
});
|
||||
}
|
||||
get_args() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue