diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 1f57b25d402..b334d340b98 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -137,7 +137,7 @@
-
+
diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml
index b4cb2a99b7a..75b639b1b79 100644
--- a/addons/hr_holidays/report/available_holidays_view.xml
+++ b/addons/hr_holidays/report/available_holidays_view.xml
@@ -87,7 +87,7 @@
- Available Holidays
+ Leaves Analysis
available.holidays.report
form
tree,graph
@@ -109,7 +109,7 @@
-
+
diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py
index 5d2dc27c0de..f7b813f9cc5 100644
--- a/addons/hr_holidays/report/hr_holidays_report.py
+++ b/addons/hr_holidays/report/hr_holidays_report.py
@@ -22,67 +22,6 @@
import tools
from osv import fields,osv
-class hr_holidays_report(osv.osv):
- _name = "hr.holidays.report"
- _description = "Leaves Statistics By Employee and category"
- _auto = False
- _rec_name = 'date'
- _columns = {
- 'date': fields.date('Date', readonly=True),
- 'delay_approve': fields.float('Delay to Approve', digits=(16,2),readonly=True),
- 'year': fields.char('Year', size=4, readonly=True),
- 'day': fields.char('Day', size=15, readonly=True),
- 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
- ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
- ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
- 'date_from' : fields.datetime('Start Date', readonly=True),
- 'date_to' : fields.datetime('End Date', readonly=True),
- 'number_of_days_temp': fields.float('Number of Days', readonly=True),
- 'employee_id' : fields.many2one('hr.employee', "Employee's Name", readonly=True),
- 'category_id' : fields.many2one('hr.employee.category', "Category's Name", readonly=True),
- 'user_id':fields.many2one('res.users', 'User', readonly=True),
- 'holiday_status_id' : fields.many2one("hr.holidays.status", "Leave Type",readonly=True),
- 'department_id':fields.many2one('hr.department','Department',readonly=True),
- 'state': fields.selection([('draft', 'Draft'),
- ('confirm', 'Waiting Validation'),
- ('refuse', 'Refused'),
- ('validate', 'Validated'),
- ('cancel', 'Cancelled')]
- ,'State', readonly=True),
- }
- _order = 'date desc'
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'hr_holidays_report')
- cr.execute("""
- create or replace view hr_holidays_report as (
- select
- min(s.id) as id,
- date_trunc('day',s.create_date) as date,
- date_trunc('day',s.date_from) as date_from,
- date_trunc('day',s.date_to) as date_to,
- sum(s.number_of_days_temp) as number_of_days_temp,
- s.employee_id,
- s.category_id,
- s.user_id as user_id,
- to_char(s.date_from, 'YYYY') as year,
- to_char(s.date_from, 'MM') as month,
- to_char(s.date_from, 'YYYY-MM-DD') as day,
- s.holiday_status_id,
- s.department_id,
- s.state,
- avg(extract('epoch' from age(s.create_date,CURRENT_DATE)))/(3600*24) as delay_approve
- from
- hr_holidays s
- WHERE type='remove'
- GROUP BY
- s.create_date,s.state,s.date_from,s.date_to,
- s.employee_id,s.user_id,s.holiday_status_id,
- s.department_id, s.category_id
- )
- """)
-
-hr_holidays_report()
-
class hr_holidays_remaining_leaves_user(osv.osv):
_name = "hr.holidays.remaining.leaves.user"
_description = "Total holidays by type"
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index e2ffc0fc0e9..51ff25fea75 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -2,108 +2,6 @@
-
- hr.holidays.report.tree
- hr.holidays.report
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- hr.holidays.report.graph
- hr.holidays.report
- graph
-
-
-
-
-
-
-
-
-
-
- hr.holidays.report.search
- hr.holidays.report
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Leaves Analysis
- hr.holidays.report
- form
- tree,graph
- {'search_default_Employee':1,'search_default_department':1,"search_default_Validated":1, 'group_by':[], 'group_by_no_leaf':1}
-
-
-
-
-
hr.holidays.remaining.leaves.user.tree
hr.holidays.remaining.leaves.user
diff --git a/addons/hr_holidays/security/ir.model.access.csv b/addons/hr_holidays/security/ir.model.access.csv
index 20da4832fe2..f350b73ed64 100644
--- a/addons/hr_holidays/security/ir.model.access.csv
+++ b/addons/hr_holidays/security/ir.model.access.csv
@@ -2,6 +2,5 @@
"access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","base.group_hr_user",1,1,1,1
"access_hr_holidays_user","hr.holidays.user","model_hr_holidays","base.group_hr_user",1,1,1,1
"access_hr_holidays_remain_user","hr.holidays.ramain.user","model_hr_holidays_remaining_leaves_user","base.group_hr_user",1,1,1,1
-"access_hr_holidays_report_manager","hr.holidays.report.manager","model_hr_holidays_report","base.group_hr_manager",1,1,1,1
"access_resource_calendar_leaves_manager","resource_calendar_leaves_manager","resource.model_resource_calendar_leaves","base.group_hr_manager",1,1,1,1
"access_available_holidays_report_user","hr.available.holidays.report.user","model_available_holidays_report","base.group_hr_user",1,1,1,1