From 21b57d9aefa1694e94806f8a626d4c2b30422044 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 18:29:21 +0530 Subject: [PATCH] fix: qc created for raw materials during manufacture entry (backport #40408) (#40412) fix: qc created for raw materials during manufacture entry (#40408) (cherry picked from commit f8a1a7f51543c4782fc5a8faa3e74ef1c8606cbd) Co-authored-by: rohitwaghchaure --- erpnext/public/js/controllers/transaction.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 4e5b7fc8cd1..66ac9582b2d 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -2089,7 +2089,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe }); this.frm.doc.items.forEach(item => { - if (!item.quality_inspection) { + if (this.has_inspection_required(item)) { let dialog_items = dialog.fields_dict.items; dialog_items.df.data.push({ "docname": item.name, @@ -2113,6 +2113,16 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe } } + has_inspection_required(item) { + if (this.frm.doc.doctype === "Stock Entry" && this.frm.doc.purpose == "Manufacture" ) { + if (item.is_finished_item && !item.quality_inspection) { + return true; + } + } else if (!item.quality_inspection) { + return true; + } + } + get_method_for_payment() { var method = "erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry"; if(cur_frm.doc.__onload && cur_frm.doc.__onload.make_payment_via_journal_entry){