Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
32355 Vizualizări

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
http://dev2.d2.xxxxx.eu/web/static/lib/py.js/lib/py.js:19
Traceback:

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,
}</field>


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"/>
</button>

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

Imagine profil
Abandonează

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

Autor

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.

Related Posts Răspunsuri Vizualizări Activitate
0
ian. 21
2205
2
aug. 18
3732
0
mar. 15
4918
3
mai 24
7182
5
mar. 15
9688