mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 17:53:49 +00:00
fix: handle parent level project change
(cherry picked from commit 543b6e51c0)
This commit is contained in:
committed by
Mergify
parent
574460c009
commit
0b7684eccd
@@ -496,18 +496,28 @@ erpnext.sales_common = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
project(doc, cdt, cdn) {
|
project(doc, cdt, cdn) {
|
||||||
const item = frappe.get_doc(cdt, cdn);
|
if (!cdt || !cdn) {
|
||||||
if (item.project) {
|
if (this.frm.doc.project) {
|
||||||
$.each(this.frm.doc["items"] || [], function (i, other_item) {
|
$.each(this.frm.doc["items"] || [], function (i, item) {
|
||||||
if (!other_item.project) {
|
if (!item.project) {
|
||||||
frappe.model.set_value(
|
frappe.model.set_value(item.doctype, item.name, "project", doc.project);
|
||||||
other_item.doctype,
|
}
|
||||||
other_item.name,
|
});
|
||||||
"project",
|
}
|
||||||
item.project
|
} else {
|
||||||
);
|
const item = frappe.get_doc(cdt, cdn);
|
||||||
}
|
if (item.project) {
|
||||||
});
|
$.each(this.frm.doc["items"] || [], function (i, other_item) {
|
||||||
|
if (!other_item.project) {
|
||||||
|
frappe.model.set_value(
|
||||||
|
other_item.doctype,
|
||||||
|
other_item.name,
|
||||||
|
"project",
|
||||||
|
item.project
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
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)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user