Odoo Help


context in ir.actions.act_window

Lucas Huber
on 2/19/16, 12:54 PM 1,250 views

I try to send from a button the context 'default_project_id' to a action view, but get an error. If I change the fields : [project_id] to active_id the view opens but ofcourse from the wrong project.

The Odoo Client error message is as follows:

Uncaught Error: , undefined as prefix

Error: , undefined as prefix

 <record id="act_project_task_sprint" 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,pivot,graph</field>
<field name="context">{
'search_default_project_id': [project_id],
'default_project_id': project_id,
'search_default_sprint_id': [active_id],
'default_sprint_id': active_id,

The Button code is like this (model: project.scrum.sprint):

<button  class="oe_inline oe_stat_button" type="action" icon="fa-tasks"
name="%(act_project_task_sprint)d" context="{'default_project_id': project_id}">
<field name="task_s_backlog_count" widget="statinfo"/>

In both models (project.task and sprint) the field 'project_id' exists. What's wrong?
In the end I wan't to have this search definition in the view:

Project Project_Name, Sprint Sprint Name

You cannot use any field in the context of the action definition, just in the context of the button and make sure that you have a value for the project_id

Axel Mendoza
on 2/19/16, 1:27 PM

Ok I did read the context section of Daniel Reis Odoo Book ones more. If I have understand correctly field values can only transported form the button context to the search view definition. But is the result the same? In the search definition field I need to have both Project Project_Name, Sprint Sprint Name.

Lucas Huber
on 2/20/16, 9:33 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/19/16, 12:54 PM
Seen: 1250 times
Last updated: 2/20/16, 9:29 AM