<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="survey_survey_view_form" model="ir.ui.view">
        <field name="name">survey.survey.view.form.inherit.recruitment</field>
        <field name="model">survey.survey</field>
        <field name="inherit_id" ref="survey.survey_survey_view_form"/>
        <field name="mode">primary</field>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='survey_type']" position="attributes">
                <attribute name="invisible">True</attribute>
            </xpath>
            <button name="action_send_survey" position="attributes">
                <attribute name="invisible">True</attribute>
            </button>
            <button name="action_start_session" position="attributes">
                <attribute name="invisible">True</attribute>
            </button>
            <button name="action_archive" position="attributes">
                <attribute name="invisible">True</attribute>
            </button>
            <xpath expr="//group[@name='scoring']" position="attributes">
                <attribute name="invisible">True</attribute>
            </xpath>
            <xpath expr="//label[@for='is_time_limited']" position="attributes">
                <attribute name="invisible">True</attribute>
            </xpath>
            <xpath expr="//div[@name='is_time_limited']" position="attributes">
                <attribute name="invisible">True</attribute>
            </xpath>
            <xpath expr="//field[@name='scoring_type']" position="attributes">
                <attribute name="invisible">True</attribute>
            </xpath>
            <xpath expr="//label[@for='certification']" position="attributes">
                <attribute name="invisible">True</attribute>
            </xpath>
            <xpath expr="//div[@name='certification']" position="attributes">
                <attribute name="invisible">True</attribute>
            </xpath>
            <xpath expr="//group[@name='live_session']" position="attributes">
                <attribute name="invisible">True</attribute>
            </xpath>
        </field>
    </record>

    <record id="survey_survey_view_kanban" model="ir.ui.view">
        <field name="name">survey.survey.view.kanban.inherit.recruitment</field>
        <field name="model">survey.survey</field>
        <field name="inherit_id" ref="survey.survey_survey_view_kanban"/>
        <field name="mode">primary</field>
        <field name="arch" type="xml">
            <button name="action_send_survey" position="attributes">
                <attribute name="invisible">True</attribute>
            </button>
            <button name="action_start_session" position="attributes">
                <attribute name="invisible">True</attribute>
            </button>
        </field>
    </record>

    <record id="survey_survey_action_recruitment" model="ir.actions.act_window">
        <field name="name">Interviews</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">survey.survey</field>
        <field name="domain">[('survey_type', '=', 'recruitment')]</field>
        <field name="view_ids" eval="[(5, 0, 0),
            (0, 0, {'view_mode': 'kanban', 'view_id': ref('hr_recruitment_survey.survey_survey_view_kanban')}),
            (0, 0, {'view_mode': 'form', 'view_id': ref('hr_recruitment_survey.survey_survey_view_form')}),
        ]"/>
        <field name="view_mode">kanban,list,activity,form</field>
        <field name="context">{
                'default_survey_type': 'recruitment',
            }
        </field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Add a new survey
            </p><p>
                You can create surveys used for recruitments. Design easily your interview,
                send invitations and analyze answers.
            </p>
        </field>
    </record>

    <menuitem
        id="menu_hr_recruitment_config_surveys"
        name="Interviews"
        action="survey_survey_action_recruitment"
        parent="hr_recruitment.menu_hr_recruitment_configuration"
        sequence="50"
        groups="hr_recruitment.group_hr_recruitment_manager"/>
</odoo>
