تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
32451 أدوات العرض

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

الصورة الرمزية
إهمال

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

الكاتب

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.

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يناير 21
2227
2
أغسطس 18
3785
0
مارس 15
4977
3
مايو 24
7230
5
مارس 15
9716