瀏覽代碼

fix: incorrect attachment limit message (#17848) (#17849)

(cherry picked from commit a01967c182)

Co-authored-by: Ankush Menat <ankush@frappe.io>
version-14
mergify[bot] 2 年之前
committed by GitHub
父節點
當前提交
d3608fb0bb
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. +7
    -4
      frappe/public/js/frappe/form/sidebar/attachments.js

+ 7
- 4
frappe/public/js/frappe/form/sidebar/attachments.js 查看文件

@@ -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…
取消
儲存