From 544b0f64d1844e687fe7dc17cab4c771c4fd8508 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 10 Aug 2012 15:37:54 +0530 Subject: [PATCH] cascade project name to other items, if selected in one item during purchase cycle --- .../buying/doctype/purchase_common/purchase_common.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 68dc8c73d4..522a7041d4 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -636,4 +636,15 @@ cur_frm.cscript.check_charge_type_and_get_tax_amount = function(doc, tax, t, cl, cur_frm.cscript.toggle_contact_section = function(doc) { doc.supplier ? unhide_field("contact_section") : hide_field("contact_section"); +} + +cur_frm.cscript.project_name = function(doc, cdt, cdn) { + var item_doc = locals[cdt][cdn]; + if (item_doc.project_name) { + $.each(getchildren(cur_frm.cscript.tname, doc.name, cur_frm.cscript.fname, doc.doctype), + function(i, v) { + if (v && !v.project_name) v.project_name = item_doc.project_name; + }); + refresh_field(cur_frm.cscript.fname); + } } \ No newline at end of file