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

I'm having a hard time convincing the Finance team to "live with" the order of the Accounting Menus in Odoo.

The top level Menus - Dashboard, Customers, Vendors, Accounting, Reporting, Configuration - those aren't the ones they are concerned about.

It is the next level down, examples:

 

I am only asking because it has been brought up in three separate meetings as a "concern" so I'd rather just concede and placate the team rather than push back since there are other issues we need to be focusing on.  

We have spent more time than is sensible talking about it and when I mentioned it to the CEO, hoping he would see how ridiculous a request it was, he told me he could see their point and if it was an easy fix he thinks it should be changed.

I understand I can drag the Menu's around in in Developer Mode via Settings --> Technical --> User Interface --> Menu Items but there are a lot to work with and I understand I will also need to repeat this work after any upgrade.


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can script this, the easiest way would be to create a Server Action based script (so you can run it directly).

accounting_menu = env["ir.ui.menu"].search([("name", "=", "Accounting"), ("parent_id", "=", False)])
top_level_menus = env["ir.ui.menu"].search([("parent_id", "=", accounting_menu.id)])
   
def sort_menus(menu):
    submenus = env["ir.ui.menu"].search([('name','!=',"Settings"),("parent_id", "=", menu.id)])
    if submenus:
        sorted_submenus = sorted(submenus, key=lambda m: m.name.lower())
        for index, submenu in enumerate(sorted_submenus, start=1):
            submenu['sequence'] = index * 10 
            sort_menus(submenu) 

for menu in top_level_menus:
    sort_menus(menu)


This excludes the SETTINGS Menu, so it still shows as the first sub menu under CONFIGURATION - so adjust the code if you want that included in the sort.


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ส.ค. 25
1402
1
ก.ค. 25
2044
[18.0] Odoo go live checklist แก้ไขแล้ว
1
ก.ค. 25
1132
[Odoo18][Accounting] CPA005 Guidance แก้ไขแล้ว
1
มิ.ย. 25
12867
1
ก.พ. 22
4764