Skip to content

Commit

Permalink
Merge pull request #45187 from frappe/mergify/bp/version-15/pr-45184
Browse files Browse the repository at this point in the history
fix: not able to see create Quality Inspection button (backport #45183) (backport #45184)
  • Loading branch information
rohitwaghchaure authored Jan 9, 2025
2 parents 6a86913 + 5d7a3b5 commit 430c482
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 430c482

Please sign in to comment.