fix: handle parent level project change

(cherry picked from commit 543b6e51c0)
This commit is contained in:
SowmyaArunachalam
2026-01-27 15:37:14 +05:30
committed by Mergify
parent 574460c009
commit 0b7684eccd

View File

@@ -496,6 +496,15 @@ erpnext.sales_common = {
} }
project(doc, cdt, cdn) { project(doc, cdt, cdn) {
if (!cdt || !cdn) {
if (this.frm.doc.project) {
$.each(this.frm.doc["items"] || [], function (i, item) {
if (!item.project) {
frappe.model.set_value(item.doctype, item.name, "project", doc.project);
}
});
}
} else {
const item = frappe.get_doc(cdt, cdn); const item = frappe.get_doc(cdt, cdn);
if (item.project) { if (item.project) {
$.each(this.frm.doc["items"] || [], function (i, other_item) { $.each(this.frm.doc["items"] || [], function (i, other_item) {
@@ -509,6 +518,7 @@ erpnext.sales_common = {
} }
}); });
} }
}
let me = this; let me = this;
if (["Delivery Note", "Sales Invoice", "Sales Order"].includes(this.frm.doc.doctype)) { if (["Delivery Note", "Sales Invoice", "Sales Order"].includes(this.frm.doc.doctype)) {
if (this.frm.doc.project) { if (this.frm.doc.project) {