Open an External URL from Menu Item in Odoo

In Odoo a menu item can link to an external URL. URL action (ir.actions.act_url) allows opening a URL (website/web page) via an Odoo action.

Here is the menu item code and its action:

<record model="ir.actions.act_url" id="act_reports">
    <field name="name">Reports</field>
    <field name="url"></field>
    <field name="target">new</field>

<menuitem name="Reports" id="menu_reports" parent="menu_root" action="act_reports"/>

You can follow these steps if you don’t want to create a new module:

  1. Go to the Odoo backend and select the application for which you want to add the menu item.
  2. Navigate to the “Settings” menu and click on “Technical” to access the developer mode.
  3. Go to “User Interface” and select “Menu Items” to create a new menu item or edit an existing one.
  4. In the “Action” tab, select “Execute Server Action” and create a new server action.
  5. In the server action, select “ir.actions.act_url” as the model and specify the URL you want to open in the “URL” field.
  6. Save the server action and go back to the menu item configuration. In the “Action” field, select the newly created server action.
  7. Save the menu item and you’re done! Now, when you click on the menu item, it will open the specified URL in a new tab.

It’s important to note that the URL you specify must include the protocol (e.g. http:// or https://). Also, make sure the URL is accessible from the server where your Odoo instance is running.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top