Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: ir_act_window_view question

by
Olivier Dony (odo)
- 09/05/2014 06:13:02
On 09/04/2014 09:07 PM, Maxim Litnitskiy wrote:
> Hi dear Experts.
> I have a question.
> In the screenshot attached we can that action can have views attached.
> This makes possible to bind specific views to specific action and not use
> default model views (I have different UI for admin and user on same model).
> But is there a way to specify that views when using action declaration?

Sure, but the  tag does not provide any shortcut for this.
One way to do it is to declare them as new records of the 
`ir.actions.act_window.view` model, setting the `act_window_id` column to the 
action they belong to.
Here is an example:
   https://github.com/odoo/odoo/blob/11de2fb/addons/crm/res_partner_view.xml#L50

Cheers,