[minor] budget link in cost center, fixes #6093

This commit is contained in:
Rushabh Mehta 2016-08-18 12:35:58 +05:30
parent b8a8fb5877
commit b969c2cb60
2 changed files with 8 additions and 3 deletions

View File

@ -32,8 +32,13 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.toggle_display('sb1', doc.is_group==0)
cur_frm.set_intro(intro_txt);
if(!cur_frm.doc.__islocal) {
cur_frm.add_custom_button(__('Chart of Cost Centers'),
function() { frappe.set_route("Tree", "Cost Center"); }, __("View"))
function() { frappe.set_route("Tree", "Cost Center"); });
cur_frm.add_custom_button(__('Budget'),
function() { frappe.set_route("List", "Budget", {'cost_center': cur_frm.doc.name}); });
}
}
cur_frm.cscript.parent_cost_center = function(doc, cdt, cdn) {

View File

@ -80,7 +80,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
} else {
filters = {
'item_code': item.item_code,
'posting_date': me.frm.doc.posting_date || nowdate(),
'posting_date': me.frm.doc.posting_date || frappe.datetime.nowdate(),
}
if(item.warehouse) filters["warehouse"] = item.warehouse