Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
17879 Lượt xem

Friends,

Usually i write sequence for menu from settings>User Interface>Menu Items in odoo.

Can we write it directly in any files like we write access writes for a group?

Thanks..

Ảnh đại diện
Huỷ bỏ
Tác giả

THANK U ALL!!!

Câu trả lời hay nhất

Hello aisha,

You can give sequence on menus through code by simply adding sequence attribute on that particular menu in xml file where usually menuitem is defined. The higher sequence number will set that menu downer accordingly. Default sequence will be set to 10 for any menu. For example,

<menuitem id="menuitem_id" name="Position/Of/The/Menu/Item/In/The/Tree" action="action_id" icon="NAME_FROM_LIST" groups="groupname" sequence="<integer>"/>

example-

    <menuitem id="menu_fleet_reporting_costs"
              parent="menu_fleet_reporting"
              action="action_fleet_reporting_costs"
              sequence="1"
              groups="group_fleet_manager"/>

Note - Menu items with the same sequence numbers are sorted by order of creation (_order = "sequence,id").

And yeah after updating xml file, Don't forget to update that module to apply changes.

For more details, You can go through doc link

Hope this will help you.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You can set the menu item sequence in the view XML file.

An example would be:

<menuitem name="Phone Calls" id="menu_crm_case_phone"
        groups="base.group_sale_salesman"
        parent="base.menu_base_partner" sequence="4" />

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,you may use this in your xml file

<menuitem id="menu_email_templates" parent="menu_configuration_misc" action="action_email_templates" sequence="30" groups="base.group_no_one"/>

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 1 24
8653
0
thg 1 24
7
0
thg 2 23
5034
0
thg 1 23
94
1
thg 10 22
4321