Merge pull request #25744 from mujeerhashmi/fix-project-kanban-filter-hotfix

fix: Project filter for Kanban Board
This commit is contained in:
Marica 2021-05-18 17:36:30 +05:30 committed by GitHub
commit 0b29bc0eeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"), () => {
frappe.call('erpnext.projects.doctype.project.project.create_kanban_board_if_not_exists', {
project: frm.doc.project_name
project: frm.doc.name
}).then(() => {
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):
from frappe.desk.doctype.kanban_board.kanban_board import quick_kanban_board
if not frappe.db.exists('Kanban Board', project):
quick_kanban_board('Task', project, 'status', project)
project = frappe.get_doc('Project', project)
if not frappe.db.exists('Kanban Board', project.project_name):
quick_kanban_board('Task', project.project_name, 'status', project.name)
return True