I think the way it's presented in the outliner is a bit confusing. What you have to understand is Collections have global properties :
hide_select 
hide_viewport 
hide_render 
And view layer properties, which are accessed with a LayerCollection object :
exclude 
hide_viewport
(I know, it's presented as the same path as the monitor icon one, but bear with me)
holdout 
indirect_only 
Global properties are accessed in a straightforward way, ie bpy.data.collections["Collection"].hide_select = True for instance. This will make the collection unselectable across ALL view layers. Same goes for viewport and render visibility.
View layer- related properties are accessed by their relative layer_collection which is a property of one and only one view_layer. Each collection has a related layer_collection object for each view_layer in the current scene. This object is responsible for holding and modifying its view layer properties.
The tricky part is collections don't hold a direct reference to their (theoretically infinite number of) layer_collection counterparts. You have to traverse the entire view layer's layer collections to test against the current collection, and only then can you change its properties. (I'd love to be corrected if there is an easier way).
Note that LayerCollection does have a direct reference to its unique collection object. (layer_coll.collection)
It then becomes really similar to this question.
import bpy
def traverse_tree(t):
yield t
for child in t.children:
yield from traverse_tree(child)
coll_name = "Collection"
layer_coll_master = bpy.context.view_layer.layer_collection
for layer_coll in traverse_tree(layer_coll_master):
if layer_coll.collection.name == coll_name:
layer_coll.indirect_only = False
break
I guess the short answer to your question is, no, you can't change this property with a one-liner expression in python. (Again, please correct me if I'm wrong)
bpy.context.view_layer.active_layer_collection.indirect_onlyas you found out at first, then reverting the active collection back after. But it may have unintended consequences... – Gorgious Jul 13 '21 at 06:20