Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
17690 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
apr 16
5849
1
apr 25
3084
1
apr 23
12132
2
set 21
44111
2
mag 20
5742