Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
7609 Переглядів

Hi, I am working on odoo 10, in that i need to add a submenu called "Category" under "Shop" menu. While using "edit" option in website it is easy to add.. and its working properly but instead of using "Edit" i would like to add the submenu from coding itself..

So, when i try to add using coding its not coming under "shop" menu it will add "category" option next to the "shop" menu

Eg: From coding

it will add the category next to shop..


Eg: using Edit option on website

it will add the category under shop menu. This is what i need from coding itself..

can anyone help me to get the "category" submenu under the "shop" menu..


Аватар
Відмінити
Найкраща відповідь

Odoo deals with menus by using website.menu model.

By the way, it is designed as a Nested Model.

https://en.wikipedia.org/wiki/Nested_set_model

You have to do is that just insert a new record with field parent_id here because Odoo makes up menu tree automatically.

Heres example

<?xml version="1.0" encoding="utf-8"?>
<odoo>
     <record id="submenu_item1" model="website.menu">
         <field name="name">Submenu 1</field>
<field name="url">/page/test</field>
<field name="parent_id" ref="website_sale.menu_shop" />
     </record>
</odoo>



See this line

<field name="parent_id" ref="website_sale.menu_shop" />

Attribute ref is an XML ID. You can search it at Settings -> Sequence & Identifiers -> External Identifiers.

Input website.menu on searching form with Model Name condition then you can see the list of menus.

Аватар
Відмінити
Найкраща відповідь

Hello Silviaa,
We hope this will help you to resolve your problem.


https://apps.odoo.com/apps/modules/13.0/website_multi_menu_submenu_oin/


Thank you.
Skype: live:info_850626 OR (info@odooitnow.com)

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
вер. 17
2839
0
квіт. 17
2977
2
вер. 24
4317
5
лют. 24
24181
1
вер. 18
106