fix: not able to see create Quality Inspection button
(cherry picked from commit b291835ccd)
This commit is contained in:
committed by
Mergify
parent
5e32796987
commit
a79cae1fef
@@ -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"));
|
||||||
|
|||||||
Reference in New Issue
Block a user