In Odoo version 17, can I insert views (model="ir.ui.view") inside view depending on a field of the model of the main view? Like this one:
<odoo>
<data>
<record model="ir.ui.view" id="shipment_form_view">
<field name="name">shipment.form.view</field>
<field name="model">shipment</field>
<field name="arch" type="xml">
<form>
<field name="transport" />
<!--
If transport == air, use air.shipment.form.view
If transport == ocean, use ocean.shipment.form.view
-->
</record>
<record model="ir.ui.view" id="air_shipment_form_view">
<field name="name">air.shipment.form.view</field>
<field name="model">shipment</field>
<form>
<field name="name"/>
<field name="flight_no"/>
...
</record>
<record model="ir.ui.view" id="ocean_shipment_form_view">
<field name="name">ocean.shipment.form.view</field>
<field name="model">shipment</field>
<form>
<field name="name"/>
<field name="voyage_no"/>
...
</record>
...
I tried using the using the owl directive but it displayed an error, that it is illegal
<t t-if>
Thanks, I do not have karma to check or upvote your comments.