Skip to content

Commit

Permalink
fix: not able to see create Quality Inspection button
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Jan 9, 2025
1 parent 00dadc1 commit b291835
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit b291835

Please sign in to comment.