fix: not able to see create Quality Inspection button

This commit is contained in:
Rohit Waghchaure
2025-01-09 14:31:01 +05:30
parent 00dadc1a89
commit b291835ccd

View File

@@ -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"));