In Odoo 14 Enterprise, you can return a form view with a record list in the domain using the action attribute of the wizard's return statement. The action attribute should be set to a dictionary that specifies the view type, view_mode, and domain.
Here's an example of how you can do this in your wizard:
Copy codeclass MyWizard(models.TransientModel):
_name = 'my_wizard'
# fields and methods
def action_show_records(self):
domain = [('field_name', '=', self.field_value)]
action = {
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'my_model',
'target': 'current',
'domain': domain,
}
return action
In this example, the action_show_records method returns an action that opens a form view of the my_model model, filtered by the domain specified in the domain attribute.
The target attribute set to 'current' will open the form view in the current window, replacing the wizard.
You can also set the target attribute to 'new' if you want to open the form view in a new window.
Note that, in this example, the form view will show only the first record that matches the domain, but if you want to show all the records that match the domain, you can set the view_mode to 'tree,form' and set 'view_id' to formview_id of that specific model.