This question has been flagged
1 Reply
4065 Views

For eg: 

action : project.project

Different Menu : Project, Implementation, ...

We are calling same action for different menus, both the menus are idependent. When we create a record in Project Menu,it should not appear in Implementation menu,viceversa.

<record model="ir.actions.act_window.view" id="a_unique_name_as_id"> <field name="sequence" eval="2"/> <field name="view_mode">form</field> <field name="view_id" ref="your_view_ref_id"/><!--use ref="purchase_order_hash_form_test"--> <field name="act_window_id" ref="your_action_reference_id"/><!--use ref='action_PO_hash_test'--> </record>

I know this.

But i want to know,Any solution to assign Menus for same action through xml code or interface?

Avatar
Discard

I think need to create two different action for same object w/ith based on domain condition. Example Refer Base Module res_partner_view.xml File.

Author

You mean for supplier and customer?? But still we can view all partners there?

Best Answer

The below  example,  two Actions created for same object In the First menu its shows only record (check field value is True).

In the second Menu its shows only record (check field value is Fasle).

Example,

    <record id="action_custom_project_view" model="ir.actions.act_window">
        <field name="name">Project Mangement</field>
        <field name="res_model">project.project</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="domain">[('field_name','=',True)]</field>
        <field name="search_view_id" ref="view_project_filter" />
        <field name="context">{}</field>
     </record>

    <record id="action_custom_impl_view" model="ir.actions.act_window">
        <field name="name">Imp</field>
        <field name="res_model">project.project</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="domain">[('field_name','=',False)]</field>
        <field name="search_view_id" ref="view_project_filter" />
        <field name="context">{}</field>
     </record>

 <menuitem id="menu_project_form" parent="" action="action_custom_project_view" sequence="1"/>

 <menuitem id="menu_imp_form" parent="" action="action_custom_impl_view" sequence="2"/>

Avatar
Discard