This question has been flagged

How to give context/domain to RedirectWarning's action parameter.

action = self.env.ref('stock.stock_product_normal_action')
raise RedirectWarning(error_msg, action.id, _('Go to the Archived Product'))

This lands on product page, my aim is to land on archived product list. (Active = False)

Also if possible, in the redirected list view, have to filter out particular product/products using some domain like..

'domain': [('id', 'in', some_search.ids)],
Avatar
Discard
Best Answer
Hi Nirmalraj,

Yes, You can pass the active_idsto open those specific records while RedirectWarning raised with Specific Action.

below Code will help you get that solve it.

raise RedirectWarning(
warning_msg, self.env.ref('hr_timesheet.timesheet_action_project').id,
_('See timesheet entries'), {'active_ids': projects_with_timesheets.ids})

Thanks & Regards,
Sunny Sheth
Avatar
Discard

For Example, you can check below link to see how it's use exactly in official ODOO.

https://github.com/odoo/odoo/blob/15.0/addons/hr_timesheet/models/project.py#L185-L187

Thanks