تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
7531 أدوات العرض

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)

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
سبتمبر 17
2797
0
أبريل 17
2881
2
سبتمبر 24
4234
5
فبراير 24
24088
1
سبتمبر 18
106