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

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 23
2030
1
ส.ค. 22
2875
0
พ.ย. 18
3234
Select multiple elements with XPath แก้ไขแล้ว
5
ส.ค. 24
46763
2
เม.ย. 24
2598