Merge pull request #31531 from nihantra/pur_inv_docstatus

fix: Set the condition to create a purchase receipt
This commit is contained in:
Deepesh Garg 2022-07-05 22:47:17 +05:30 committed by GitHub
commit b785d7b904
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'));