In Invoice tree view , trying to override the attribute optional="show" to "hide" of inherited tree view?
1 i creted new custom module this the new view
<record id="hide_view_order_form_inherit" model="ir.ui.view">
<field name="name">account.move.inherit.view</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_out_invoice_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_date']" position="replace">
<field name="invoice_date" optional="hide"/>
</xpath>
</field>
</record>
didn't work
You can overwrite the xml attributes instead of replacing the whole field.
Try with the following:
This way you only replace the 'optional' attribute with 'hide'