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

    <record id="view_task_form2" model="ir.ui.view">
        <field name="name">project.project.form</field>
        <field name="model">project.task</field>
        <field name="inherit_id" ref="project.view_task_form2" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='pr_uri']" position="after">
                    <field
                    name="pr_state"
                    attrs="{'invisible': [('pr_uri', '=', False)]}"
                />
            </xpath>
        </field>
    </record>

    <record id="view_task_search_form" model="ir.ui.view">
        <field name="name">Project.task.pr.state.search</field>
        <field name="model">project.task</field>
        <field name="inherit_id" ref="project.view_task_search_form" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='stage_id']" position="after">
                <field name="pr_state" />
            </xpath>
            <xpath expr="//group[1]" position="before">
                <separator />
                <filter
                    string="Has PR"
                    name="has_pr"
                    domain="[('pr_uri','!=',False)]"
                />
            </xpath>
            <xpath expr="//group[1]" position="inside">
                <separator />
                <filter
                    string="PR State"
                    name="pr_state"
                    context="{'group_by':'pr_state'}"
                />
            </xpath>
        </field>
    </record>

</odoo>
