Riken Bhorania (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-17354-rch into 
lp:openobject-addons/6.0.

Requested reviews:
  Raphael Collet (OpenERP) (rco-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17354-rch/+merge/75671

Hello,

The rules has been suggested by R&D team:

- Employee group: can create Leave Allocation/Leave Request/Expanses and 
confirm them.
- Human Resources / User: can validate the Leave Allocation/Leave 
Request/Expanses. (Team Lead or Manager apart from HR Dept.)
- Human Resources / Manager: can do the second validation and configure the HR 
stuff and consult reporting. (Manager from HR Dept.)

The issue is regarding the user having 'Human Resources / User' group but does 
not have 'Human Resources / Manager' group.

Such user have the access rights to validate Leave Allocation/Leave 
Request/Expanses (On the 'Approve' button). 

However, the Record Rules are configured so that the user can see only his 
Leave Allocation/Leave Request/Expanses. 

According to the rules such user should able to see (and hence can validate) 
other employees' Leave Allocation/Leave Request/Expanses. (more specifically 
his department's employees).

Here, the solution having updated Record Rules for related objects has been 
proposed. 

Thanks,
Riken
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17354-rch/+merge/75671
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-17354-rch.
=== modified file 'hr_expense/security/ir_rule.xml'
--- hr_expense/security/ir_rule.xml	2011-01-17 11:35:21 +0000
+++ hr_expense/security/ir_rule.xml	2011-09-16 05:34:40 +0000
@@ -5,7 +5,7 @@
         <record id="property_rule_expense" model="ir.rule">
             <field name="name">Employee Expense</field>
             <field model="ir.model" name="model_id" ref="model_hr_expense_expense"/>
-            <field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
+            <field name="domain_force">['|', ('employee_id.user_id','=',user.id),('department_id.manager_id.user_id','=',user.id)]</field>
             <field name="groups" eval="[(4,ref('base.group_hr_user'))]"/>
         </record>
         <record id="property_rule_expense_manager" model="ir.rule">

=== modified file 'hr_holidays/security/ir_rule.xml'
--- hr_holidays/security/ir_rule.xml	2011-01-17 11:35:21 +0000
+++ hr_holidays/security/ir_rule.xml	2011-09-16 05:34:40 +0000
@@ -5,7 +5,7 @@
     <record id="property_rule_holidays" 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="domain_force">['|', ('employee_id.user_id','=',user.id),('department_id.manager_id.user_id','=',user.id)]</field>
         <field name="groups" eval="[(6,0,[ref('base.group_hr_user')])]"/>
     </record>
     <record id="property_rule_holidays_manager" model="ir.rule">

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to