Skip to Content
मेन्यू
This question has been flagged

In this question I asked how to create a menu icon pointing to a location, and that worked great many times.

However now I'm wondering if I can create such a link that will actually visit a specific filter in that page, instead of just giving me the default one.

Like I already have Shared and Favourite filters saved, I'd like to select one of those automatically in case I visit through that button (while keeping the Default intact if I visit normally through elsewhere).

Avatar
Discard
Best Answer

Hii


Use filter_id in the URL

Go to your saved filter in Odoo (e.g., your "Shared" or "Favorite" filter).

Enable Developer Mode.

Look at the URL in your browser — you’ll see something like this when you select your filter:

/web#model=res.partner&view_type=list&filter_id=42

Copy that entire URL (with filter_id=...).

Use this URL in your menu item, button, or external link.

i hope it is use full

Avatar
Discard
Author

Hi, that's what I would have guessed, but the URL doesn't actually change it at all when I visit filters, it just stays clean with no `#` thingies.

Hii,
You’re right — Odoo’s UI doesn’t always update the URL with the filter state, so just copying the URL with filter_id might not work as expected.
How to reliably open a saved filter programmatically:
Find the filter ID:
Go to Settings > Technical > User Interface > Filters (enable Developer Mode first)

Search your filter by name (e.g., "Shared")

Note its numeric ID (say 42)

Use a URL with filter_id parameter explicitly:

The URL format is:
/web#action=<action_id>&model=<model_name>&view_type=list&filter_id=42
where <action_id> is the ID of the action attached to your menu (can be found in Settings > Technical > Actions > Window Actions).

This URL forces Odoo to load the view with that filter applied.

Author

Oh thanks, that sounds promising! I'll try it as soon as I remember what I actually wanted to link back then :D

Related Posts Replies Views Activity
0
जन॰ 16
65
4
जून 21
13378
0
अग॰ 15
4429
0
अग॰ 25
95
3
अग॰ 25
861