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

Hi all, I am doing one of my own module.

I have several menu item in my view. I want to make one of the menu item a hyperlink point to a specific URL.

I have no idea how to do this... Currently all menu items views are done with something like tree, form, kanban...

What I want is when click a menu item, it will jump to another page.

Thank you all!

아바타
취소
베스트 답변

You could assign an action of type ir.actions.act_url, like:

<record model="ir.actions.act_url" id="action_google_url">

<field name="name">Open google.com</field>

<field name="url">https://google.com</field>

<field name="target">new</field>

</record>

use it normally in a menuitem like:

<menuitem parent="menu_parent" id="menu_google_url" action="action_google_url"/>
아바타
취소
작성자

@Axel Mendoza, Thank you! This is exactly what i want. Sorry i don't have enough karma to comment your answer. BTW, could you tell me where may I find those APIs or methods like your answer? I did't find any Odoo document that is convenient to check.

I use source code review and examples as my primary source of documentation. Also those are stuffs learned through years of using OpenERP and Odoo

작성자

Strangely, the string "Open google.com" inside field "name" is not shown in the menu... instead it shows the id of menuitem without "_". Do you have any idea?

No clue but you could set the string attribute for the menuitem

작성자

string attribute doesn't work as well...

작성자

finally i set a name attribute for menuitem and it works! Thanks bro!

작성자 베스트 답변

@Axel Mendoza, Thank you! This is exactly what i want. Sorry i don't have enough karma to comment your answer.

BTW, could you tell me where may I find those APIs or methods like your answer? I did't find any Odoo document that is convenient to check.

아바타
취소
관련 게시물 답글 화면 활동
0
1월 23
1831
1
8월 22
2708
0
11월 18
3082
5
8월 24
46298
2
4월 24
2374