From a79cae1fefb31e85b59bc2993ef5497d1e2bab31 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 9 Jan 2025 14:31:01 +0530 Subject: [PATCH] fix: not able to see create Quality Inspection button (cherry picked from commit b291835ccda4b7696ba5aee05628f2c647be667f) --- erpnext/public/js/controllers/transaction.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 9e3a76b12ca..79ed7d0a836 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -302,8 +302,13 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe return; } + let show_qc_button = true; + if (["Sales Invoice", "Purchase Invoice"].includes(this.frm.doc.doctype)) { + show_qc_button = this.frm.doc.update_stock; + } + const me = this; - if (!this.frm.is_new() && this.frm.doc.docstatus === 0 && frappe.model.can_create("Quality Inspection") && this.frm.doc.update_stock) { + if (!this.frm.is_new() && this.frm.doc.docstatus === 0 && frappe.model.can_create("Quality Inspection") && show_qc_button) { this.frm.add_custom_button(__("Quality Inspection(s)"), () => { me.make_quality_inspection(); }, __("Create"));