Hi,
The developper doc says you can use a type "action" in kanban box:
Buttons and fields
While most of the Kanban templates are standard QWeb, the Kanban view processes field, button and a elements specially:
by default fields are replaced by their formatted value, unless they match specific kanban view widgets
buttons and links with a type attribute become perform Odoo-related operations rather than their standard HTML function. Possible types are:
action, object standard behavior for Odoo buttons, most attributes relevant to standard Odoo buttons can be used. ...
In the project_view.xml you find that the kanban project view is linked to an action called : act_project_project_2_project_task_all:
<div class="oe_kanban_project_list">
<a t-if="record.use_tasks.raw_value" name="%(act_project_project_2_project_task_all)d" type="action" style="margin-right: 10px">
<t t-raw="record.task_count.raw_value"/> Tasks
</a>
</div>
This action ( which is in the same module) filter the tasks of the active project :
<record id="act_project_project_2_project_task_all" model="ir.actions.act_window">
<field name="name">Tasks</field>
<field name="res_model">project.task</field>
<field name="view_mode">kanban,tree,form,calendar,gantt,graph</field>
<field name="context">{
'search_default_project_id': [active_id],
'default_project_id': active_id,
'active_test': False,
}</field>
...
Edit :
To use 'search_default_project_id', you must have a search view where one filter named "project_id" exists.
See more explanations here :https://www.odoo.com/forum/help-1/question/set-default-filter-value-in-search-view-5856
If I'm not wrong, the key 'default_project_id': active_id means that, if you create a task, its project_id will be automatically set to active_id ( ie the project you clicked in kanban view).