<?xml version="1.0" ?>
<openerp>
    <data>
        
        <!-- 
            Process
        -->
        
        <record id="process_process_hrtimesheetprocess0" model="process.process">
            <field eval="1" name="active"/>
            <field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
            <field eval="&quot;&quot;&quot;Hr Timesheet&quot;&quot;&quot;" name="name"/>
        </record>
        
        <!-- 
            Process Node
        -->
    
        <record id="process_node_attendance0" model="process.node">
            <field name="model_id" ref="hr.model_hr_employee"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Attendance&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Employee's timesheet entry&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_hrtimesheetprocess0"/>
            <field eval="1" name="flow_start"/>
        </record>
    
        <record id="process_node_timesheet0" model="process.node">
            <field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
            <field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
            <field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Timesheet&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Information of time spent on a service&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_hrtimesheetprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>
    
        <record id="process_node_drafttimesheetsheet0" model="process.node">
            <field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
            <field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Draft Timesheet&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;State is 'draft'.&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_hrtimesheetprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>
    
        <record id="process_node_confirmedtimesheet0" model="process.node">
            <field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
            <field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Confirmed&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;State is 'confirmed'.&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_hrtimesheetprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='confirm'&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>

        <record id="process_node_validatedtimesheet0" model="process.node">
            <field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
            <field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Validated&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;State is 'validated'.&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="process_process_hrtimesheetprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='done'&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>
    
        <record id="process_node_invoiceonwork0" model="process.node">
            <field name="menu_id" ref="account.menu_finance_receivables"/>
            <field name="model_id" ref="account.model_account_invoice"/>
            <field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Invoice on Work&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Based on the timesheet&quot;&quot;&quot;" name="note"/>
            <field name="subflow_id" ref="account.process_process_invoiceprocess0"/>
            <field name="process_id" ref="process_process_hrtimesheetprocess0"/>
            <field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
            <field eval="0" name="flow_start"/>
        </record>

        <record id="process_node_workontask0" model="process.node">
            <field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
            <field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
            <field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
            <field eval="&quot;&quot;&quot;Work on Task&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Defines the work summary of task&quot;&quot;&quot;" name="note"/>
            <field name="process_id" ref="hr_timesheet_sheet.process_process_hrtimesheetprocess0"/>
            <field eval="&quot;&quot;&quot;object.state in ('open', pending', 'done', 'cancelled')&quot;&quot;&quot;" name="model_states"/>
            <field eval="1" name="flow_start"/>
        </record>
        
        <!-- 
            Process Transition
        -->
        
        <record id="res_roles_hr0" model="res.roles">
            <field eval="&quot;&quot;&quot;HR&quot;&quot;&quot;" name="name"/>
        </record>
        
        <record id="hr_timesheet_sheet.t1" model="workflow.transition">
            <field name="role_id" ref="res_roles_hr0"/>
        </record>
    
        <record id="process_transition_attendancetimesheet0" model="process.transition">
            <field eval="[(6,0,[])]" name="role_ids"/>
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Sign in/out&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;The employee signs in and signs out.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_drafttimesheetsheet0"/>
            <field model="process.node" name="source_node_id" ref="process_node_attendance0"/>
        </record>
    
        <record id="process_transition_timesheetdraft0" model="process.transition">
            <field eval="[(6,0,[])]" name="role_ids"/>
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Service&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;The timesheet line represents the time spent by the employee on a specific service provided.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_drafttimesheetsheet0"/>
            <field model="process.node" name="source_node_id" ref="process_node_timesheet0"/>
        </record>
    
        <record id="process_transition_confirmtimesheet0" model="process.transition">
            <field eval="[(6,0,[])]" name="role_ids"/>
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Confirmation&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;The employee periodically confirms his own timesheets.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_confirmedtimesheet0"/>
            <field model="process.node" name="source_node_id" ref="process_node_drafttimesheetsheet0"/>
            <field eval="[(6,0,[ref('hr_timesheet_sheet.t1')])]" name="transition_ids"/>
        </record>
    
        <record id="process_transition_validatetimesheet0" model="process.transition">
            <field eval="[(6,0,[])]" name="role_ids"/>
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;The project manager validates the timesheets.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_validatedtimesheet0"/>
            <field model="process.node" name="source_node_id" ref="process_node_confirmedtimesheet0"/>
        </record>
    
        <record id="process_transition_invoiceontimesheet0" model="process.transition">
            <field eval="[(6,0,[])]" name="role_ids"/>
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Billing&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;The invoice is created based on the timesheet.&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_invoiceonwork0"/>
            <field model="process.node" name="source_node_id" ref="process_node_confirmedtimesheet0"/>
        </record>
        
        <record id="process_transition_tasktimesheet0" model="process.transition">
            <field eval="[(6,0,[])]" name="role_ids"/>
            <field eval="[(6,0,[])]" name="transition_ids"/>
            <field eval="&quot;&quot;&quot;Task timesheet&quot;&quot;&quot;" name="name"/>
            <field eval="&quot;&quot;&quot;Moves task entry into the timesheet line&quot;&quot;&quot;" name="note"/>
            <field model="process.node" name="target_node_id" ref="process_node_timesheet0"/>
            <field model="process.node" name="source_node_id" ref="process_node_workontask0"/>
         </record>        
        
        <!-- 
            Process Action
        -->
        
        <record id="process_transition_action_draftconfirmtimesheet0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;button_confirm&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Confirm&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_confirmtimesheet0"/>
        </record>
        
        <record id="process_transition_action_validatetimesheet0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;write({'state':'done'})&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Validate&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_validatetimesheet0"/>
        </record>
        
        <record id="process_transition_action_refusetimesheet0" model="process.transition.action">
            <field eval="&quot;&quot;&quot;write({'state':'draft'})&quot;&quot;&quot;" name="action"/>
            <field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
            <field eval="&quot;&quot;&quot;Refuse&quot;&quot;&quot;" name="name"/>
            <field name="transition_id" ref="process_transition_validatetimesheet0"/>
        </record>
        
    </data>
</openerp>
