Hi,
We can disable the form view of the one2many field by assigning the following style to the field.
<field name="your_o2m" style="pointer-events:none;" />
But the issue is this style will disable the click in editable state too.
It will be better to define a form view to that field, then the click will open the form view which we assigned.
Eg:
We can define a form view like below

let invoice_line_ids is our one2many field and normally we will define a view with <tree></tree> for getting a tree view.For getting a required form view, we just need to define our required view inside <form></form> along with that like above.
Hope it helps.