Skip to Content
Menu
This question has been flagged
1 Reply
3758 Views

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
Discard
Author Best Answer

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
Discard