Skip to content

Commit

Permalink
Merge pull request #52 from ashish-greycube/patch-2
Browse files Browse the repository at this point in the history
fix: file_name should be required only when custom_attachment is 1
  • Loading branch information
shridarpatil authored Jan 10, 2024
2 parents 076d0ed + 8ed0e30 commit 780f635
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ frappe.ui.form.on('WhatsApp Notification', {
)
},
custom_attachment: function(frm){
if(frm.doc.custom_attachment && ['DOCUMENT', "IMAGE"].includes(frm.doc.header_type)){
if(frm.doc.custom_attachment == 1 && ['DOCUMENT', "IMAGE"].includes(frm.doc.header_type)){
frm.set_df_property('file_name', 'reqd', frm.doc.custom_attachment)
}else{
frm.set_df_property('file_name', 'reqd', !frm.doc.custom_attachment)
frm.set_df_property('file_name', 'reqd', 0)
}

// frm.toggle_display("attach_document_print", !frm.doc.custom_attachment);
Expand Down

0 comments on commit 780f635

Please sign in to comment.