diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py index bdd902923eb..bfb211de864 100644 --- a/addons/hr_holidays/__openerp__.py +++ b/addons/hr_holidays/__openerp__.py @@ -55,6 +55,7 @@ 'hr_holidays_view.xml', 'hr_holidays_wizard.xml', 'hr_holidays_report.xml', + 'wizard/hr_holidays_summary_department_view.xml', #'process/hr_holidays_process.xml' ], 'demo_xml': [], diff --git a/addons/hr_holidays/hr_holidays_wizard.xml b/addons/hr_holidays/hr_holidays_wizard.xml index a747571c943..92064620e02 100644 --- a/addons/hr_holidays/hr_holidays_wizard.xml +++ b/addons/hr_holidays/hr_holidays_wizard.xml @@ -11,15 +11,15 @@ name="Holidays" parent="hr.menu_hr_reporting" sequence="3" /> - - --> + diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index c61e8f733b4..e3a59e8344d 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -39,8 +39,8 @@ def strToDate(dt): dt_date=datetime.date(int(dt[0:4]),int(dt[5:7]),int(dt[8:10])) return dt_date else: - return - + return + def emp_create_xml(self,cr,uid,dept,holiday_type,row_id,empid,name,som,eom): display={} @@ -48,11 +48,11 @@ def emp_create_xml(self,cr,uid,dept,holiday_type,row_id,empid,name,som,eom): count=0 p_id=pooler.get_pool(cr.dbname).get('hr.holidays').search(cr,uid,[('employee_id','in',[empid,False]), ('type', '=', 'remove')]) ids_date = pooler.get_pool(cr.dbname).get('hr.holidays').read(cr,uid,p_id,['date_from','date_to','holiday_status_id','state']) - + for index in range(1,61): diff=index-1 current=som+datetime.timedelta(diff) - + for item in ids_date: if current >= strToDate(item['date_from']) and current <= strToDate(item['date_to']): if item['state'] in holiday_type: @@ -216,13 +216,13 @@ class report_custom(report_rml): emp_xml += emp_create_xml(self,cr,uid,0,holiday_type,row_id,items['id'],items['name'],som, eom) row_id = row_id +1 - + elif data['model']=='ir.ui.menu': - for id in data['form']['depts'][0][2]: + for id in data['form']['depts']: dept = pooler.get_pool(cr.dbname).get('hr.department').browse(cr, uid, id, context.copy()) depts.append(dept) - dept_ids = tuple(data['form']['depts'][0][2]) - + dept_ids = tuple(data['form']['depts']) + cr.execute("""select dept_user.user_id \ from hr_department_user_rel dept_user \ where dept_user.department_id = %s\ @@ -258,7 +258,7 @@ class report_custom(report_rml): %s ''' % (months_xml,date_xml, emp_xml) - + return xml report_custom('report.holidays.summary', 'hr.holidays', '', 'addons/hr_holidays/report/holidays_summary.xsl') diff --git a/addons/hr_holidays/wizard/__init__.py b/addons/hr_holidays/wizard/__init__.py index 310328a15c1..f021cfc09d7 100644 --- a/addons/hr_holidays/wizard/__init__.py +++ b/addons/hr_holidays/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,11 +15,11 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## -import holidays_summary +import hr_holidays_summary_department import holidays_summary_employees # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_holidays/wizard/holidays_summary.py b/addons/hr_holidays/wizard/holidays_summary.py deleted file mode 100644 index 0b6a05247f0..00000000000 --- a/addons/hr_holidays/wizard/holidays_summary.py +++ /dev/null @@ -1,97 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# $Id: account.py 1005 2005-07-25 08:41:42Z nicoe $ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import wizard -import datetime -import time -import pooler - -form=''' -
- - - - -''' - -zero_form=''' -
-