Community mailing list archives

community@mail.odoo.com

Re: How to assign the values ​​of the field views in actions ?

by
e-acta, Brahim EL ALLIOUI
- 03/30/2016 05:16:42
Thank you  Ankit 


Brahim EL ALLIOUI
General Manager
Skype : belallioui
Tel : +212535749410
Mobile : +212661940077


2016-03-29 15:28 GMT+01:00 Ankit Gandhi <er.ankitgandhi2013@gmail.com>:
Dear Brahim,

I updated your code.

Hope below code help for you.

<record id="eacta_action_mrp_farm_operation" model="ir.actions.act_window">
    <field name="name">Interventions</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">eacta.data.mrp.farm.operation</field>
<field name="view_mode">tree,form,graph</field>
<field name="limit">10</field>
<field name="search_view_id" ref="eacta_search_view_mrp_farm_operation"/>

<field name="views" >[
('eacta_tree_view_mrp_farm_operation', tree),
('eacta_form_view_mrp_farm_operation', form),
('eacta_graph_view_mrp_farm_operation', graph)
]
</field>

Cheers,

On Tue, Mar 29, 2016 at 6:16 PM, Brahim EL ALLIOUI <belallioui@gmail.com> wrote:

Thank you Omar,

it did not work

In documentation :
views
a list of (view_id, view_type) pairs. The second element of each pair is the category of the view (tree, form, graph, ...) and the first is an optional database id (or False). If no id is provided, the client should fetch the default view of the specified type for the requested model (this is automatically done by fields_view_get()). The first type of the list is the default view type and will be open by default when the action is executed. Each view type should be present at most once in the list


Brahim EL ALLIOUI
General Manager
Skype : belallioui
Tel : +212535749410
Mobile : +212661940077


2016-03-29 13:26 GMT+01:00 Omar Ouhari <omar.ouhari@gmail.com>:
Hello,

You can do this by using context like that :

<field name="context">{'form_view_ref': your_form_view, 'tree_view_ref': your_tree_view}</field>
I think it will be the same for graph but I am not sur.

Try and tell us.

Omar OUHARI
Consultant IT
Tel : + 212.6.77.55.20.23

2016-03-29 12:58 GMT+01:00 Brahim EL ALLIOUI <belallioui@gmail.com>:

Hi,

How to assign the values ​​of the field views in actions ?

Example : 
<record id="eacta_action_mrp_farm_operation" model="ir.actions.act_window">
<field name="name">Interventions</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">eacta.data.mrp.farm.operation</field>
<field name="view_mode">tree,form,graph</field>
<field name="limit">10</field>
<field name="search_view_id" ref="eacta_search_view_mrp_farm_operation"/>

<field name="views" >[
['eacta_tree_view_mrp_farm_operation', tree],
['eacta_form_view_mrp_farm_operation', form],
['eacta_graph_view_mrp_farm_operation', graph]
]
</field>
Thanks,


Brahim EL ALLIOUI
General Manager
Skype : belallioui
Tel : +212535749410
Mobile : +212661940077

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
Thanks and Regards,
Er.Ankit H Gandhi

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe