跳至內容
選單
此問題已被標幟
2 回覆
6240 瀏覽次數

Edit: Answered! Thanks!

Accomplish:
I want to combine point of sale and inventory menu items into 1 custom module titled "storefront". Then disable the pos and inventory modules from the menu.

Example: 
OpenHRMS 12.0 does this perfectly. They combined all HR modules into 1 module and the menu items of the regular modules are removed from the main menu. Its beautiful.

What i have - errors out when upgrading custom module - this should lead to the main pos dashboard:

<menuitem name="Dashboard" id="action_pos_dash_menu" parent="storefront_root_menu"

              sequence="1" action="point_of_sale.menu_pos_dashboard" groups="base.group_user"/>


How i got this:
I just used the standard method of creating a menuitem however i went to settings > menu items > pos dashboard > view meta data to see get "point_of_sale.menu_pos_dashboard"

頭像
捨棄
最佳答案

Hi,

If you are looking to replace some existing menus to some other position, like suppose if you want to change the POS Dashboard menu as submenu of the new menu you have created, you can do it like this,

<menuitem id="point_of_sale.menu_pos_dashboard"
action="action_pos_config_kanban"
parent="storefront_root_menu"
name="Dashboard"
sequence="1"/>


Where the ID is the id of the original Dashboard menu in POS, this will make the Dashboard menu under your new menu and will remove the original one from the Point of sale menu.

EIther you can use this way, or you can add a new menu rather than rewriting the existing menu and then you can hide the original menu by adding some groups to menu in which no users are there.


Thanks

頭像
捨棄
作者 最佳答案

EDIT: I figured it out! Thanks so much! You guys are awesome :)

Hey, Cybrosys, thank you so much for the reply! And thank you for OpenHrms, you guys are amazing! <3 

I'd send this as a comment but i need 1 more karma point to do so. 

Follow up question: So ID = XML ID in metadata. Where do you get the action? Your example has "action_pos_config_kanban". Where can i find that for all other menu items? 

Thanks again! Really! :)

頭像
捨棄

If you activate the developer mode and navigate to settings -> technical -> User interface -> menu items, you can see all the menu there, open the menu and from the lady debugger button you can get the id of the menu from the meta data. From the menu form, you can see its sub menus as well as the action of the form

作者

Okay, final follow up question. I was able to get my module to upgrade and your recommendation works! I figured out how to find the action too! Thanks! However, how can i have 2 menu items leading to the same place? In my example before i had a module called "storefront". Now lets say i have another module called "Distribution". Both storefront and distribution will need the inventory module. Can i do that with this method or will one override the other?

相關帖文 回覆 瀏覽次數 活動
1
3月 19
5866
0
3月 19
3349
0
5月 25
153
1
5月 25
343
1
5月 25
410