This is Odoo 14 code that inherit the group and make create and edit False Which Works Great
<record id="product_template_merch_only_form_view" model="ir.ui.view">
<field name="name">product.template.readonly.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="groups_id" eval="[(4, ref('group_nocreateedit_user'))]"/>
<field name="arch" type="xml">
<data><xpath expr="//form" position="attributes">
<attribute name="edit">false</attribute>
<attribute name="create">false</attribute>
<attribute name="name">Product Template</attribute>
</xpath>
</data>
</field>
</record>
now this same i want to work with odoo17 but from odoo16 "groups_id" remove from "ir.ui.view" so how to do that in odoo17 if any other field then we can make it readonly based on _compute function but i did not get anything for this