fix: Set the condition to create a purchase receipt

This commit is contained in:
Nihantra C. Patel 2022-07-05 21:19:50 +05:30 committed by GitHub
parent 37f7801cfb
commit 3e670eda68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -539,7 +539,7 @@ frappe.ui.form.on("Purchase Invoice", {
},
add_custom_buttons: function(frm) {
if (frm.doc.per_received < 100) {
if (frm.doc.docstatus == 1 && frm.doc.per_received < 100) {
frm.add_custom_button(__('Purchase Receipt'), () => {
frm.events.make_purchase_receipt(frm);
}, __('Create'));