How to allow adding context in url parameters and get the data in model/view?

22 views Asked by At

Odoo 14 Community Edition

Odoo normally allows accessing views via urls by specifying necessary properties for it. For example, {host}/web#id=23&action=985&model=product.template&view_type=form&cids=1&menu_id=688 will redirect the user to product page in my server.

Here comes the point. I created a new tree view with a new model. I would like to access this tree view by url while adding some contexts to it, so that I can use it in the model/views.

How to achieve such task?

I have already tried

  1. Adding &context={'my_context':'123'} right after its url. The part gets removed upon loading the view.
  2. I don't know what cids is, but I tried putting some data in there, and it sticks there. However, I don't know how to use it. It most likely exists for other reasons, not my case. So, I don't want to use it.
0

There are 0 answers