Since cce70fd4 the attachment menu is only displayed for form view.
But if in another view there is active_ids (eg. selecting record in a
list view), we will still make a query to ir.attachment without using
the result.
Without the code change, the added test would fail when doing a
search_read RPC call to ir.attachment model.
related to #26213