Merge pull request #31919 from SolufyPrivateLimited/Solufy-pur_inv_docstatus

fix: Set the condition to create a purchase receipt
This commit is contained in:
Deepesh Garg
2022-08-25 10:35:14 +05:30
committed by GitHub

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'));