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

This commit is contained in:
rohitwaghchaure
2024-03-12 18:11:12 +05:30
committed by GitHub
parent 948297692e
commit f8a1a7f515

View File

@@ -2229,7 +2229,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,
@@ -2253,6 +2253,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){