Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4185 Vistas

Hello,

In Odoo 8 is it possible to assign default view to the "Add an item" button?

My idea is opening form instead of tree view  when "Add an item" is clicked.

If i click this button i see POST request

"kwargs":{"view_id":false,"view_type":"search"......}

How to set view_id and view_type ?

Avatar
Descartar
Autor Mejor respuesta

I figured it out. My field was Many2many, i set it's widget to one2many and now it opens a form when i click "Add an item".

<field name="contracts" colspan="2" context="{'default_supplier': id}" widget="one2many">
Avatar
Descartar