summaryrefslogtreecommitdiff
path: root/addons/hr_holidays/views
diff options
context:
space:
mode:
authorKevin Baptiste <kba@odoo.com>2020-04-09 14:55:52 +0000
committerKevin Baptiste <kba@odoo.com>2020-04-20 09:19:48 +0000
commitb8a8ad27de40e856d713b0d57c1f8f591e1e4523 (patch)
tree9eb7bf2fc10c10e005dbec93f7b5778d41cd9a74 /addons/hr_holidays/views
parent755e00bdcd792ef5a788963212048cd1d15ce241 (diff)
[FIX] hr_holidays: "Everyone" view on calendar_event
Purpose ======= Avoid to show to much information to leave responsibles. Specification ============= - Dynamically add/remove the leave_manager_ids on the group group_hr_holidays_responsible, on employee creation/modification - Retrict the available employees when creating a leave. For manager/users : Everyone. For responsibles: The employee for who the user is responsible. Otherwise: Only me. - Don't obfuscate the leave name on employees for who I'm the responsible. - Add a new SQL view for "Everyone" report. To select only the information we want to share instead of showing the hr.leave model directly. closes odoo/odoo#47659 closes odoo/odoo#49765 Taskid: 2206862 Related: odoo/enterprise#9239 Related: odoo/enterprise#10021 X-original-commit: 781147dcaf1552b8f2ab687ed73034b8fd1f7352 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/hr_holidays/views')
-rw-r--r--addons/hr_holidays/views/hr_holidays_views.xml1
-rw-r--r--addons/hr_holidays/views/hr_leave_allocation_views.xml6
-rw-r--r--addons/hr_holidays/views/hr_leave_views.xml17
3 files changed, 6 insertions, 18 deletions
diff --git a/addons/hr_holidays/views/hr_holidays_views.xml b/addons/hr_holidays/views/hr_holidays_views.xml
index 832de6634fc..5357839bc06 100644
--- a/addons/hr_holidays/views/hr_holidays_views.xml
+++ b/addons/hr_holidays/views/hr_holidays_views.xml
@@ -50,6 +50,7 @@
id="hr_holidays_menu_manager_approve"
name="To Approve"
parent="menu_hr_holidays_approvals"
+ groups="hr_holidays.group_hr_holidays_responsible,hr_holidays.group_hr_holidays_user"
sequence="1"/>
<menuitem
diff --git a/addons/hr_holidays/views/hr_leave_allocation_views.xml b/addons/hr_holidays/views/hr_leave_allocation_views.xml
index e2d66fb694b..265ca7c6fd7 100644
--- a/addons/hr_holidays/views/hr_leave_allocation_views.xml
+++ b/addons/hr_holidays/views/hr_leave_allocation_views.xml
@@ -200,7 +200,7 @@
<button string="Approve" name="action_approve" type="object"
icon="fa-check text-success"
states="confirm"
- groups="hr_holidays.group_hr_holidays_user"/>
+ groups="hr_holidays.group_hr_holidays_responsible"/>
<button string="Validate" name="action_validate" type="object"
icon="fa-check text-success"
states="validate1"
@@ -371,8 +371,8 @@
<field name="name">Department Allocation to Approve</field>
<field name="res_model">hr.leave.allocation</field>
<field name="view_mode">tree,form,kanban,activity</field>
- <field name="context">{'search_default_managed_people':1, 'search_default_approve':1}</field>
- <field name="domain">[]</field>
+ <field name="context">{'search_default_approve':1}</field>
+ <field name="domain">[('employee_id.leave_manager_id', '=', uid)]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new time off allocation
diff --git a/addons/hr_holidays/views/hr_leave_views.xml b/addons/hr_holidays/views/hr_leave_views.xml
index e9945f98ea1..ddac0c7336c 100644
--- a/addons/hr_holidays/views/hr_leave_views.xml
+++ b/addons/hr_holidays/views/hr_leave_views.xml
@@ -501,7 +501,7 @@
<button string="Approve" name="action_approve" type="object"
icon="fa-check text-success"
states="confirm"
- groups="hr_holidays.group_hr_holidays_user"/>
+ groups="hr_holidays.group_hr_holidays_responsible"/>
<button string="Validate" name="action_validate" type="object"
icon="fa-check text-success"
states="validate1"
@@ -546,18 +546,6 @@
</field>
</record>
- <record id="action_hr_holidays_dashboard" model="ir.actions.act_window">
- <field name="name">All Time Off</field>
- <field name="res_model">hr.leave</field>
- <field name="view_mode">calendar,tree,form</field>
- <field name="context">{
- 'form_view_ref': 'hr_holidays.hr_leave_view_form_manager',
- }</field>
- <field name="domain">[('holiday_type','=','employee'), ('state', '!=', 'refuse')]</field>
- <field name="search_view_id" ref="view_hr_holidays_filter"/>
- <field name="view_id" />
- </record>
-
<record id="hr_leave_action_new_request" model="ir.actions.act_window">
<field name="name">Dashboard</field>
<field name="res_model">hr.leave</field>
@@ -663,11 +651,10 @@
<field name="res_model">hr.leave</field>
<field name="view_mode">tree,kanban,form,calendar,activity</field>
<field name="context">{
- 'search_default_managed_people':1,
'search_default_my_team_leaves':1,
'search_default_approve':1}
</field>
- <field name="domain">[]</field>
+ <field name="domain">[('employee_id.leave_manager_id', '=', uid)]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new time off request