When checking a tree view I want to be able to double click in a record and open the form view in a new tab.
Let's assume my model is something like:
class new_model(osv.osv):
_name= model.name
...
new_model()
I tried this but it is not working!
<record id="action_view_model_new_tab" model="ir.actions.act_window">
<field name="name">Open New Tab</field>
<field name="type>ir.actions.act_window</field>
<field name="res_model>model.name</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<record id="ir_open_model_new_tab" model="ir.values">
<field name="key2">tree_but_open</field>
<field name="model">model.name</field>
<field name="name">Open in New Tab</field>
<field name="value" eval="'ir.actions.act_window,+str(ref(action_view_model_new_tab))/>
<field name="object>True</field>
</record>
ADDED INFO:
I also tried doing this:
<record id="action_view_model_tree" model="ir.actions.act_window">
<field name="name">Open Tree View</field>
<field name="type>ir.actions.act_window</field>
<field name="res_model>model.name</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
<record id="action_view_model_new_tab" model="ir.actions.act_window">
<field name="name">Open New Tab</field>
<field name="type>ir.actions.act_window</field>
<field name="res_model>model.name</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record id="ir_open_model_new_tab" model="ir.values">
<field name="key2">tree_but_open</field>
<field name="model">model.name</field>
<field name="name">Open in New Tab</field>
<field name="value" eval="'ir.actions.act_window,+str(ref(action_view_model_new_tab))/>
<field name="object>True</field>
</record>
Assuming that there is a way to open the tree view (e.g. a menu item or something else). But doing this, has the effect that the double click causes a refresh of the tree view and nothing else. And also, the form button is not clickable.
Hi, thanks for th vote and edited answer for url, but now I have a bug on my rights to mark my answer as correct, see : http://help.openerp.com/question/4051/bug-on-this-forum-right-lost-for-function-mark-after-moderation-of-a-user-answer/