Skip to Content
Menu
This question has been flagged
1 Reply
16630 Views

I can pass context for smart buttons like this and the action will receive the context:

         
<button class="oe_inline oe_stat_button" type="action" 
         name="%(action_view_issues_of_task)d"
context="{'search_default_task_id': [active_id], 'default_task_id': active_id, 'default_project_id': project_id or False, 'default_partner_id': partner_id or False,}"
icon="fa-bug">
<field
string="Issues" name="issue_count" widget="statinfo"/>
</button>


but i could not find a way to pass the context to the related action in a kanban view link or button:


<a style="margin-right: 10px" name="%(action_view_issues_of_task)d" type="action" context="{'search_default_task_id': [active_id], 'default_task_id': active_id, 'default_project_id': project_id or False, 'default_partner_id': partner_id or False,}">

    <t t-raw="record.issue_count.raw_value"/> Issues

</a>


Is it possible to pass the context in a kanban view link or button?

Avatar
Discard
Best Answer

You can t-attf-data-context

Example:

<a style="margin-right: 10px" name="%(action_view_issues_of_task)d" type="action" t-attf-data-context="{'search_default_task_id': [active_id], 'default_task_id': active_id, 'default_project_id': project_id or False, 'default_partner_id': partner_id or False,}">

Avatar
Discard
Related Posts Replies Views Activity
0
Apr 16
5265
1
Apr 23
10574
2
Sep 21
42274
0
Jun 21
1989
2
May 20
4410