This question has been flagged
1 Reply
2495 Views

Greetings,

I'm trying to create a module with menu on the top bar .

every thing is fine but once i clicked on the menu item , the module view its not openning and nothing happens at all.

Here is me code :

<?xml version="1.0" encoding="utf-8"?>

<openerp>

    <data>

       <record model="ir.ui.view" id="cus_product_rep_form">

           <field name="name">cus.product.rep.form</field>

               <field name="model">cus.product.rep</field>

               <field name="type">form</field>

               <field name="arch" type="xml">

                   <form string="Test Base">

                       <field name="name"/>

                       <field name="code"/>

                   </form>

              </field>

        </record>

        <record model="ir.ui.view" id="cus_product_rep_tree">

            <field name="name">cus.product.rep.tree</field>

            <field name="model">cus.product.rep</field>

            <field name="type">tree</field>

            <field name="arch" type="xml">

                <tree string="Test Base">

                    <field name="name"/>

                    <field name="code"/>

                </tree>

            </field>

        </record>

        <record model="ir.actions.act_window" id="cus_product_rep_action">

            <field name="name">cus_product_rep_action</field>

            <field name="res_model">cus.product.rep</field>

            <field name="view_type">form</field>

            <field name="view_mode">form</field>

        </record>
    
        <menuitem id="menu_cus_product_rep_main" name="Statistics"/>

        <menuitem id="menu_cus_product_rep" parent="menu_cus_product_rep_main"
                  name="Statistics" action="cus_product_rep_action"/>

    </data>

</openerp>

Avatar
Discard
Best Answer

I think you need to add a third menu item in between. Try this:
 

<menuitem id="menu_cus_product_rep_main" name="Statistics"/>

<menuitem id="menu_cus_product_rep_sub" parent="menu_cus_product_rep_main" name="Manage Statistics"/>

<menuitem id="menu_cus_product_rep" parent="menu_cus_product_rep_sub"
                  name="Statistics" action="cus_product_rep_action"/>

 

Also, modify 

<field name="view_mode">form</field>

to 

<field name="view_mode">tree,form</field>

Avatar
Discard