<?xml version="1.0"?>
<openerp>
  <data>
    <record id="property_rule_holidays_employee" model="ir.rule">
        <field name="name">Employee Holidays</field>
        <field model="ir.model" name="model_id" ref="model_hr_holidays"/>
        <field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
        <field name="perm_create" eval="False"/>
        <field name="perm_write" eval="False"/>
        <field name="perm_unlink" eval="False"/>
        <field name="groups" eval="[(4,ref('base.group_user'))]"/>
    </record>

    <record id="property_rule_holidays_employee_write" model="ir.rule">
        <field name="name">Employee Holidays Create, Write, Unlink</field>
        <field model="ir.model" name="model_id" ref="model_hr_holidays"/>
        <field name="domain_force">[('employee_id.user_id','=',user.id), ('state', 'in', ['draft', 'confirm', 'cancel'])]</field>
        <field name="perm_read" eval="False"/>
        <field name="groups" eval="[(4,ref('base.group_user'))]"/>
    </record>
    
    <record id="property_rule_holidays_officer" model="ir.rule">
        <field name="name">Holidays Officer</field>
        <field model="ir.model" name="model_id" ref="model_hr_holidays"/>
        <field name="domain_force">[(1,'=',1)]</field>
        <field name="groups" eval="[(4,ref('base.group_hr_user'))]"/>
    </record>
    
  </data>
</openerp>
