Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
32487 Lượt xem

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

Ảnh đại diện
Huỷ bỏ

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

Tác giả

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.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 1 21
2233
2
thg 8 18
3812
0
thg 3 15
5000
3
thg 5 24
7254
5
thg 3 15
9737