Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
4 Ответы
20789 Представления

In odoo12 enterprise edition, I created a module, its all submenus are added to the top menu but not their parent menu.

In my code, first, I added the outsourcing menu to the website.main_menu and some submenu to the outsourcing menu. The result is that all submenus are added to the website.main_menu.
Another problem is that after uninstalling the module, there are unremoved submenu items in the menu of the website's configuration.

The following is my code. what is the problem?

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="0">
<record id="main_menu" model="website.menu">
<field name="name">Outsourcing</field>
<field name="url">/outsourcing</field>
<field name="parent_id" ref="website.main_menu"/>
<field name="sequence">11</field>
</record>
<record id="issue_requirement" model="website.menu">
<field name="name">issue task</field>
<field name="url">/outsourcing/issue_task</field>
<field name="parent_id" ref="outsourcing.main_menu"/>
<field name="sequence">12</field>
</record>
</data>
</odoo>
Аватар
Отменить
Лучший ответ

Hi,

Can you please remove the  URL from the first record and try once more.

<record id="main_menu" model="website.menu">
<field name="name">Outsourcing</field>
<field name="parent_id" ref="website.main_menu"/>
<field name="sequence">11</field>
</record>



See the Below sample we have tried,

<record id="menu_shop" model="website.menu">
<field name="name">Shop</field>
<field name="parent_id" ref="website.main_menu"/>
<field name="sequence" type="int">20</field>
</record>
<record id="menu_test_shop" model="website.menu">
<field name="name">Sub Menu</field>
<field name="url">/shop</field>
<field name="parent_id" ref="menu_shop"/>
<field name="sequence" type="int">20</field>
</record>


Result:


Thanks

Аватар
Отменить
Лучший ответ

did you find the solution? I have the same problem with odoo 14

Аватар
Отменить
Лучший ответ

You can try like this,

add one more field "website_id"

<record id="menu_shop" model="website.menu">
<field name="name">Shop</field>
<field name="parent_id" ref="website.main_menu"/>
<field name="sequence" type="int">20</field>
<field name="website_id" ref="website.default_website"/>
</record>
Аватар
Отменить
Автор Лучший ответ

Cybrosys Techno Solutions Pvt.Ltd:

Thank you very much, because I can't comment on your post, it needs at least 300 karmas. So I post on here.

I tried your suggestion, but the problem is still there. I read the code, I think it is a bug. I filed an issue on odoo github.  https://github.com/odoo/odoo/issues/30783

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
авг. 25
411
5
авг. 25
9966
2
июл. 25
1026
4
июн. 25
1168
1
июн. 25
1479