In Odoo13 I have an act_window action for multiple records in list (tree) view. It is supposed to change ownership on leads using a custom wizard. The ownership can only be changed on leads, not on opportunities.
I would like to hide this action when listing opportunities. As the binding model for this action is "crm.lead" this action shows also for opportunities because they share the same model. For now I solve this in a Python code [pseudocode] if type != 'lead': raise UserError(...)
.
So I can avoid the unallowed ownership change on an opportunity but it would be more user friendly if the action is hidden for opportunities. I tried to apply domain: domain="[('type', '=', 'lead')]"
in the definition of act_window
but with no effect. Is it actually possible to control visibility of ir.action using a domain?