fix: not able to see create Quality Inspection button

(cherry picked from commit b291835ccd)
This commit is contained in:
Rohit Waghchaure
2025-01-09 14:31:01 +05:30
committed by Mergify
parent 5e32796987
commit a79cae1fef

View File

@@ -302,8 +302,13 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
return; 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; 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)"), () => { this.frm.add_custom_button(__("Quality Inspection(s)"), () => {
me.make_quality_inspection(); me.make_quality_inspection();
}, __("Create")); }, __("Create"));