2009-11-24 16:01:44 |
Niels Huylebroeck |
description |
I have a button like this :
<button name="%(action_crm_project_task_work)d" type="action" icon="gtk-go-forward" string="Create Task Work" colspan="2" context="{'project_id': project_id}"/>
The action it is calling :
<record id="action_fks_crm_project_task_work" model="ir.actions.act_window">
<field name="name">Enter work for project</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">project.task.work</field>
<field name="view_id" ref="project_work_entry.project_work_entry_project_task_work_view"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>
On the model project.task.work I have written a custom function which reads in context, and if 'project_id' is in the context it alters the view slightly (applying a domain on a field)
The problem is in linux and the webclient this action works as the context is indeed correctly passed, in the windows client it throws this error when calling the action :
Traceback (most recent call last):
File "widget\view\form_gtk\parser.pyo", line 132, in button_clicked
File "modules\action\main.pyo", line 79, in execute
File "modules\action\main.pyo", line 108, in _exec_action
File "tools\__init__.pyo", line 36, in expr_eval
File "<string>", line 1, in <module>
NameError: name 'project_id' is not defined |
I have a button like this :
<button name="%(action_crm_project_task_work)d" type="action" icon="gtk-go-forward" string="Create Task Work" colspan="2" context="{'project_id': project_id}"/>
The action it is calling :
<record id="action_crm_project_task_work" model="ir.actions.act_window">
<field name="name">Enter work for project</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">project.task.work</field>
<field name="view_id" ref="project_work_entry.project_work_entry_project_task_work_view"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>
On the model project.task.work I have written a custom function which reads in context, and if 'project_id' is in the context it alters the view slightly (applying a domain on a field)
The problem is in linux and the webclient this action works as the context is indeed correctly passed, in the windows client it throws this error when calling the action :
Traceback (most recent call last):
File "widget\view\form_gtk\parser.pyo", line 132, in button_clicked
File "modules\action\main.pyo", line 79, in execute
File "modules\action\main.pyo", line 108, in _exec_action
File "tools\__init__.pyo", line 36, in expr_eval
File "<string>", line 1, in <module>
NameError: name 'project_id' is not defined
|
|