open-synergy/opnsynid-hr

View on GitHub
hr_attendance_overtime_request_batch/views/hr_overtime_request_batch_views.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
    <data>
        <record id="hr_overtime_request_batch_view_tree" model="ir.ui.view">
            <field name="name">hr.overtime_request_batch.tree</field>
            <field name="model">hr.overtime_request_batch</field>
            <field name="arch" type="xml">
                <tree string="Batch Overtime Request">
                    <field name="name" />
                    <field name="date_start" />
                    <field name="date_end" />
                    <field name="department_id" />
                    <field name="manager_id" />
                    <field name="user_id" />
                    <field name="state" />
                </tree>
            </field>
        </record>

        <record id="hr_overtime_request_batch_view_form" model="ir.ui.view">
            <field name="name">hr.overtime_request_batch.form</field>
            <field name="model">hr.overtime_request_batch</field>
            <field name="arch" type="xml">
                <form string="Batch Overtime Request">
                    <header>
                        <button
                            name="action_confirm"
                            type="object"
                            string="Confirm"
                            class="oe_highlight"
                            attrs="{'invisible':['|',('state','!=','draft'),('confirm_ok','=',False)]}"
                        />
                        <button
                            name="action_valid"
                            type="object"
                            string="Valid"
                            class="oe_highlight"
                            attrs="{'invisible':['|',('state','!=','confirm'),('valid_ok','=',False)]}"
                        />
                        <button
                            name="action_cancel"
                            type="object"
                            string="Cancel"
                            attrs="{'invisible':['|',('state','not in',['draft','confirm','valid']),('cancel_ok','=',False)]}"
                        />
                        <button
                            name="action_restart"
                            type="object"
                            string="Set To Draft"
                            attrs="{'invisible':['|',('state','!=','cancel'),('restart_ok','=',False)]}"
                        />
                        <button
                            name="%(hr_overtime_request_by_employee_action)d"
                            type="action"
                            string="Generate Overtime Request"
                            class="oe_highlight"
                            context="{'department_id': department_id, 'manager_id': manager_id}"
                            attrs="{'invisible':['|',('state','!=','draft'),('generate_ok','=',False)]}"
                        />
                        <field
                            name="state"
                            widget="statusbar"
                            statusbar_visible="draft,confirm,valid"
                        />
                    </header>
                    <sheet>
                        <label for="name" class="oe_edit_only" />
                        <h1>
                            <field name="name" />
                        </h1>
                        <group name="group_1" colspan="4" col="2">
                            <group name="group_1_1" colspan="1" col="2">
                                <field name="date_start" />
                                <field name="date_end" />
                            </group>
                            <group name="group_1_2" colspan="1" col="2">
                                <field name="user_id" />
                                <field name="company_id" />
                                <field name="department_id" />
                                <field name="manager_id" />
                            </group>
                        </group>
                        <notebook>
                            <page name="overtime_request" string="Request(s)">
                                <field name="request_ids" colspan="4" nolabel="1" />
                            </page>
                            <page
                                name="policy"
                                string="Policy"
                                groups="base.group_system"
                            >
                                <group name="group_policy_1" colspan="4" col="2">
                                    <field name="confirm_ok" />
                                    <field name="valid_ok" />
                                    <field name="cancel_ok" />
                                    <field name="restart_ok" />
                                    <field name="generate_ok" />
                                </group>
                            </page>
                            <page name="log" string="Log" groups="base.group_system">
                                <group name="group_log_1" colspan="4" col="3">
                                    <field name="create_date" string="Creation" />
                                    <field name="create_uid" nolabel="1" />
                                    <field
                                        name="confirmed_date"
                                        string="Confirmation"
                                    />
                                    <field name="confirmed_user_id" nolabel="1" />
                                    <field name="validated_date" string="Validation" />
                                    <field name="validated_user_id" nolabel="1" />
                                    <field
                                        name="cancelled_date"
                                        string="Cancellation"
                                    />
                                    <field name="cancelled_user_id" nolabel="1" />
                                </group>
                            </page>
                        </notebook>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="hr_overtime_request_batch_view_search" model="ir.ui.view">
            <field name="name">hr.overtime_request_batch.search</field>
            <field name="model">hr.overtime_request_batch</field>
            <field name="arch" type="xml">
                <search string="Search Request">
                    <field name="name" />
                    <field name="date_start" />
                    <field name="date_end" />
                    <filter
                        icon="terp-document-new"
                        string="Draft"
                        domain="[('state','=','draft')]"
                        help="Draft Request"
                    />
                    <filter
                        name="done_filter"
                        icon="terp-camera_test"
                        string="Done"
                        domain="[('state','=','close')]"
                        help="Done Request"
                    />
                </search>
            </field>
        </record>

        <record id="hr_overtime_request_batch_action" model="ir.actions.act_window">
            <field name="name">Batch Overtime Request</field>
            <field name="res_model">hr.overtime_request_batch</field>
            <field name="view_mode">tree,form</field>
            <field name="search_view_id" ref="hr_overtime_request_batch_view_search" />
        </record>

        <menuitem
            id="hr_overtime_request_batch_menu"
            name="Batch Overtime Request"
            parent="hr_attendance_overtime_request.hr_overtime_root_menu"
            action="hr_overtime_request_batch_action"
            sequence="100"
        />

    </data>
</openerp>