콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
20798 화면

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

아바타
취소
관련 게시물 답글 화면 활동
2
8월 25
507
5
8월 25
10001
2
7월 25
1052
4
6월 25
1201
1
6월 25
1514