<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="crm_case_tree_view_job_inherit" model="ir.ui.view">
        <field name="name">hr.applicant.list.inherit</field>
        <field name="model">hr.applicant</field>
        <field name="inherit_id" ref="hr_recruitment.crm_case_tree_view_job"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='source_id']" position="after">
                <field name="survey_id" column_invisible="True"/>
                <field name="response_ids" column_invisible="True"/>
            </xpath>
        </field>
    </record>

    <record id="hr_applicant_view_form_inherit" model="ir.ui.view">
        <field name="name">hr.applicant.form.inherit</field>
        <field name="model">hr.applicant</field>
        <field name="inherit_id" ref="hr_recruitment.hr_applicant_view_form"/>
        <field name="arch" type="xml">
            <xpath expr="//button[@name='archive_applicant']" position="before">
                <button name="action_send_survey" string="Send Interview" type="object" invisible="not active or not survey_id"/>
            </xpath>
            <xpath expr="//button[@name='action_create_meeting']" position="after">
                <button name="action_print_survey"
                    class="oe_stat_button"
                    icon="fa-pencil-square-o"
                    type="object"
                    help="See interview report"
                    invisible="not survey_id or not response_ids">
                    <div class="o_field_widget o_stat_info">
                        <span class="o_stat_text">Consult</span>
                        <span class="o_stat_text">Interview</span>
                    </div>
                </button>
            </xpath>
            <xpath expr="//field[@name='job_id']" position="before">
                <field name="survey_id" invisible="1"/>
                <field name="response_ids" invisible="1"/>
            </xpath>
        </field>
    </record>

    <record id="hr_kanban_view_applicant_inherit" model="ir.ui.view">
        <field name="name">hr.applicants.kanban.inherit</field>
        <field name="model">hr.applicant</field>
        <field name="inherit_id" ref="hr_recruitment.hr_kanban_view_applicant"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='user_id']" position="before">
                <field name="survey_id"/>
            </xpath>
        </field>
    </record>
</odoo>
