fix: Project filter for Kanban Board

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>
This commit is contained in:
Syed Mujeer Hashmi 2021-05-15 12:12:26 +05:30
parent 814fd19424
commit 426b04003c
2 changed files with 4 additions and 3 deletions

View File

@ -87,7 +87,7 @@ frappe.ui.form.on("Project", {
frm.add_custom_button(__("Kanban Board"), () => { frm.add_custom_button(__("Kanban Board"), () => {
frappe.call('erpnext.projects.doctype.project.project.create_kanban_board_if_not_exists', { frappe.call('erpnext.projects.doctype.project.project.create_kanban_board_if_not_exists', {
project: frm.doc.project_name project: frm.doc.name
}).then(() => { }).then(() => {
frappe.set_route('List', 'Task', 'Kanban', frm.doc.project_name); frappe.set_route('List', 'Task', 'Kanban', frm.doc.project_name);
}); });

View File

@ -523,8 +523,9 @@ def update_project_sales_billing():
def create_kanban_board_if_not_exists(project): def create_kanban_board_if_not_exists(project):
from frappe.desk.doctype.kanban_board.kanban_board import quick_kanban_board from frappe.desk.doctype.kanban_board.kanban_board import quick_kanban_board
if not frappe.db.exists('Kanban Board', project): project = frappe.get_doc('Project', project)
quick_kanban_board('Task', project, 'status', project) if not frappe.db.exists('Kanban Board', project.project_name):
quick_kanban_board('Task', project.project_name, 'status', project.name)
return True return True