Merge pull request #2344 from nabinhait/fix1

cost center based on project
This commit is contained in:
Nabin Hait 2014-10-23 13:30:51 +05:30
commit fbb994c731
2 changed files with 15 additions and 11 deletions

View File

@ -587,6 +587,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
});
frappe.ui.form.on(cur_frm.doctype,"project_name", function(frm) {
if(in_list(["Delivery Note", "Sales Invoice"], frm.doc.doctype)) {
frappe.call({
method:'erpnext.projects.doctype.project.project.get_cost_center_name' ,
args: { project_name: frm.doc.project_name },
@ -599,4 +600,5 @@ frappe.ui.form.on(cur_frm.doctype,"project_name", function(frm) {
}
}
})
}
})

View File

@ -52,6 +52,8 @@ class Address(Document):
@frappe.whitelist()
def get_address_display(address_dict):
if not address_dict:
return
if not isinstance(address_dict, dict):
address_dict = frappe.db.get_value("Address", address_dict, "*", as_dict=True) or {}