Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
20777 มุมมอง

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
392
5
ส.ค. 25
9965
Carrusel en sitios web แก้ไขแล้ว
2
ก.ค. 25
1023
How to launch my website แก้ไขแล้ว
4
มิ.ย. 25
1159
1
มิ.ย. 25
1472