我有两种形式。首先task_view.xml 显示所有用户的所有任务。在打开一个用户后的第二种形式 user_view.xml 中,我添加了 按钮
<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>
现在,当单击按钮时,我会获得所有用户的所有任务,单击按钮后如何使用上下文或任何其他解决方案,我只需要(过滤)该用户的任务。
我需要从放置按钮的表单中过滤project_task_user_id = id user。
最佳答案
试试这个:
context="{'search_default_project_task_user_id ': active_id}"
关于odoo - 在 odoo 9 中使用上下文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44195975/