Error Adding custom menu to odoo 10, Error providing here: < parent="base.menu_sales" >

199 Views Asked by At

I dont know why it don't work, when I try the following it work!

<menuitem id="dietfacts_menu" action="product.product_template_actions_dietfacts" name="Diet Items" parent="base.menu_custom"/>

But, when I change the parent attribute to base.menu_sales It don't work!!

<menuitem id="dietfacts_menu" action="product.product_template_actions_dietfacts" name="Diet Items" parent="base.menu_sales"/>

on Odoo 9, the both codes work very well, but on odoo 10, only the first!!

please help!!

2

There are 2 best solutions below

1
On BEST ANSWER

The problem lies in the XML ID you are providing to the parent.

To get the correct XML id of the menu item go Settings -> Dashboard -> Activate Developers Console

Navigate to Technical -> User Interface -> Menu Items.

Locate the parent menu by searching for it. Open it up. Click on the debugger menu present above and click over the View Metadata option.

This will show you the correct XML ID of the menu, which you can write in the parent option of the menuitem. enter image description here

Hope it helps. Thanks

0
On

In Odoo 10, this menu is not in base module, but it is in sales_team module, so you should write external id "sales_team.menu_sales" instead of "base.menu_sales"

<menuitem id="dietfacts_menu" action="product.product_template_actions_dietfacts" name="Diet Items" parent="sales_team.menu_sales"/>