<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>

        <record id="edit_project_inherited" model="ir.ui.view">
            <field name="name">project.project.form.inherit</field>
            <field name="model">project.project</field>
            <field name="inherit_id" ref="project.edit_project"/>
            <field name="arch" type="xml">
                <data>
                    <xpath expr="//page[@name='settings']" position="after">
                        <page name="sub_project" string="Sub Project">
                            <group>
                                <field name="is_sub_project"/>
                            </group>
                            <group>
                                <field name="sub_project" widget="many2many_tags"
                                       attrs="{'invisible': [('is_sub_project', '=', False)], 'required': [('is_sub_project', '=', True)]}"
                                       options="{'no_open': True, 'no_create': True, 'no_create_edit': True}"/>
                            </group>
                        </page>
                    </xpath>
                </data>
            </field>
        </record>

        <record id="inherit2_view_task_tree2" model="ir.ui.view">
            <field name="name">project.task.tree.inherit</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_tree2"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='stage_id']" position="before">
                    <field name="sub_project" widget="many2many_tags"/>
                </xpath>
            </field>
        </record>
    </data>
</odoo>