From b4c992dd4da6480b8ca1e261da41af8c13556300 Mon Sep 17 00:00:00 2001 From: Solufyin <34390782+Solufyin@users.noreply.github.com> Date: Mon, 22 Aug 2022 12:00:21 +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 0c2ec5ffa313..aed8cb56d1be 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'));