From 3e670eda68653a077e8c0ae56791d58f4b74d4fe Mon Sep 17 00:00:00 2001 From: "Nihantra C. Patel" <99652762+nihantra@users.noreply.github.com> Date: Tue, 5 Jul 2022 21:19:50 +0530 Subject: [PATCH] fix: Set the condition to create a purchase receipt --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 7e3597e491ec..686db9db2342 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -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'));