Kaynağa Gözat

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 yıl önce
committed by GitHub
ebeveyn
işleme
d3608fb0bb
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
1 değiştirilmiş dosya ile 7 ekleme ve 4 silme
  1. +7
    -4
      frappe/public/js/frappe/form/sidebar/attachments.js

+ 7
- 4
frappe/public/js/frappe/form/sidebar/attachments.js Dosyayı Görüntüle

@@ -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() {


Yükleniyor…
İptal
Kaydet