For everybody who has a similar problem, here a possible solution, or rather workaround, that works for related fields. Note, that most fields in settings view are related fields, that relate, for example, to the company or website records.
You can add a computed boolean field on the settings model, that compares if the field is the same as on the related model. In my case, this looked similar to this:
related_field = fields.Many2one("stock.warehouse", related="website_id.other_warehouse_id")
@api.onchange("related_field")
def _compute_can_execute_action_depending_on_related_field(self):
for record in self:
if not record.related_field or (
record.related_field
!= record.website_id.related_field
):
record.related_field = False
else:
record.related_field = True
can_execute_action_depending_on_related_field = fields.Boolean(
compute=_compute_can_execute_action_depending_on_related_field,
)
Then, you can use it in your settings view:
field name="can_execute_action_depending_on_related_field" invisible="1"/>
div attrs="{'invisible': [('can_execute_action_depending_on_related_field', '=', False)]}">