2
votes

I have two forms. First task_view.xml display all task for all users. In second form user_view.xml after open one user I'm add button

<button class="oe_inline oe_stat_button" style="float:right;" type="action" icon="fa-folder" name="%(task_view_form)d"
    context="{'??????}">
    <field string="total" name=total_qty" widget="statinfo" />
</button>

Now when click on button I get all task for all users, how use context or any other solution after click on button I need (filter) only task for that users.

I need filter project_task_user_id = id user from form where is placed button.

2

2 Answers

2
votes

Try this:

context="{'search_default_project_task_user_id ': active_id}"
1
votes

I think to achieve this you need to add the domain to you action:

<record id="task_view_form" ...>
    ...
    ...
    <field name="domain">[('project_task_user_id','=' , uid)] </field>
</record>