Skip to content

Commit

Permalink
fix: qc created for raw materials during manufacture entry (backport #…
Browse files Browse the repository at this point in the history
…40408) (#40413)

fix: qc created for raw materials during manufacture entry (#40408)

(cherry picked from commit f8a1a7f)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure authored Mar 12, 2024
1 parent d6e87f3 commit f932265
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,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,
Expand All @@ -2243,6 +2243,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){
Expand Down

0 comments on commit f932265

Please sign in to comment.