Hi I'm trying to do that, hide the create and edit button from product_id in move lines in stock.picking
On the invoices for example I do it like this
<record id="invoice_view_inherit_duvan1" model="ir.ui.view">
<field name="name">my.invoice.custom</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/notebook/page/field[@name='invoice_line_ids']/tree/field[@name='product_id']" position="attributes">
<attribute name="options">{'no_create_edit':True,'no_create':True,'no_open':True}</attribute>
</xpath>
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="options">{'no_create_edit':True,'no_create':True,'no_open':True}</attribute>
</xpath>
</field>
</record>
But when I try on stock picking like this
<record id="picking_view_inherit_duvan1" model="ir.ui.view">
<field name="name">my.picking.custom2</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/notebook/page/field[@name='move_lines']/tree/field[@name='product_id']" position="attributes">
<attribute name="options">{'no_create_edit':True,'no_create':True,'no_open':True}</attribute>
</xpath>
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="options">{'no_create_edit':True,'no_create':True,'no_open':True}</attribute>
</xpath>
</field>
</record>
It appears the following error
Element '<xpath expr="//form/sheet/notebook/page/field[@name='move_lines']/tree/field[@name='product_id']">' cannot be located in parent view
If someone know what I'm doing wrong I would really appreciate it
Thank you