flectra/addons/hr_holidays/security/hr_holidays_security.xml

60 lines
2.8 KiB
XML
Raw Permalink Normal View History

<?xml version="1.0" encoding="utf-8"?>
2018-01-16 11:34:37 +01:00
<flectra>
<record id="group_hr_holidays_user" model="res.groups">
<field name="name">Officer</field>
<field name="category_id" ref="base.module_category_hr_holidays"/>
<field name="implied_ids" eval="[(4, ref('hr.group_hr_user'))]"/>
</record>
<record id="group_hr_holidays_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_hr_holidays"/>
<field name="implied_ids" eval="[(4, ref('hr_holidays.group_hr_holidays_user'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
<record id="base.default_user" model="res.users">
<field name="groups_id" eval="[(4,ref('hr_holidays.group_hr_holidays_manager'))]"/>
</record>
<record id="property_rule_holidays_employee" model="ir.rule">
<field name="name">Employee Leaves</field>
<field 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 Leaves Create, Write, Unlink</field>
<field name="model_id" ref="model_hr_holidays"/>
<field name="domain_force">[('employee_id.user_id','=',user.id), ('state', 'in', ['draft', 'confirm', 'cancel', 'refuse'])]</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">Leaves Officer</field>
<field name="model_id" ref="model_hr_holidays"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4,ref('hr_holidays.group_hr_holidays_user'))]"/>
</record>
<record id="resource_leaves_officer" model="ir.rule">
<field name="name">Leaves Resources Officer</field>
<field name="model_id" ref="model_resource_calendar_leaves"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4,ref('hr_holidays.group_hr_holidays_user'))]"/>
</record>
<record id="hr_holidays_status_rule_multi_company" model="ir.rule">
<field name="name">Leaves multi company rule</field>
<field name="model_id" ref="model_hr_holidays_status"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','in',[user.company_id.id])]</field>
</record>
2018-01-16 11:34:37 +01:00
</flectra>