Merge pull request #45184 from frappe/mergify/bp/version-15-hotfix/pr-45183

fix: not able to see create Quality Inspection button (backport #45183)
This commit is contained in:
rohitwaghchaure
2025-01-09 14:50:24 +05:30
committed by GitHub

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