I made a controller from which I redirect the user to an existing action, this way:
@http.route('/url', type='http', auth='user')
def my_controller_method(self, the_used_ids, **kwargs):
...
action = request.env.ref('module.action_xml_id', False)
return request.redirect(
'/web?&#min=1&limit=80&view_type=list&'
'model=the.model&action=%s' % (action.id)
)
But I would like to modify that existing action in order to set a domain for this particular case, and show only the IDs used in the controller, like this:
@http.route('/url', type='http', auth='user')
def my_controller_method(self, the_used_ids, **kwargs):
...
action = request.env.ref('module.action_xml_id', False)
action_dict = action.sudo().read()[0]
action_dict['domain'] = [('id', 'in', the_used_ids)]
return action_dict
The problem is that Odoo doesn't allow to return a dictionary from the controller, so my question is if someone knows how to do this.