This question has been flagged
2 Replies
4569 Views


How to properly copy view in odoo 8. lets say, i want to list User Group lists in my custom module.

So far i have inherited res.groups also inherited base.res_groups_form .

Result is i have customized list of groups in my module. but also it is changed in original Menu too.

Lets i want 2 view for groups or any other things in odoo. one is original and another is my module view. is it possible.?

i think it is possible in _inherits but i hve to copy whole view code. how to do it ??

Avatar
Discard
Best Answer

For this you ca make one tree view for your menu and give reference in your action.

May be this will solved your purpose.

      <!-- define field which you want to display. -->
<record id="your_res_group_tree_view" model="ir.ui.view">
<field name="name">res.group.tree</field>
<field name="model">res.group</field>
<field name="arch" type="xml">
<tree string="Product Sequence">
<field name="name"/>
<field name="xyz" />
<field name="abc" />
</tree>
</field>
</record>

<record id="res_group_action" model="ir.actions.act_window">
<field name="name">Res Group</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.group</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="your_res_group_tree_view"/>
</record>

<record id="action_group_form" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">form</field>
<field name="view_id" ref="give_your_form_view_id/>
<field name="act_window_id" ref="res_group_action"/>
</record>
     
    <menuitem action="res_group_action"
    id="menu_res_group"
    parent="define_parent_menu" sequence="10" />
Avatar
Discard
Author Best Answer

Thanks for your reply . . it works .
previously i did that only.

Avatar
Discard

I edited the answer code. May be this will help you.

Hello, make another form view same like a tree view and give reference.