<?xml version="1.0" encoding="utf-8" ?>
<!--
    Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
    License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>

    <record id="hr_timesheet_sheet_form" model="ir.ui.view">
        <field name="name">hr_timesheet.sheet.form</field>
        <field name="model">hr_timesheet.sheet</field>
        <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form" />
        <field name="arch" type="xml">
            <xpath
                expr="//group[@name='details']/field[@name='department_id']"
                position="attributes"
            >
                <attribute name="invisible">False</attribute>
                <attribute name="attrs">
                    {
                        'invisible': [('review_policy', '!=', 'department_manager')],
                        'required': [('review_policy', '=', 'department_manager')],
                    }
                </attribute>
            </xpath>
        </field>
    </record>

</odoo>
