diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py index 7ea1b0b33ff..8b159501592 100644 --- a/addons/hr_attendance/__openerp__.py +++ b/addons/hr_attendance/__openerp__.py @@ -37,7 +37,8 @@ 'hr_attendance_view.xml', 'hr_attendance_wizard.xml', 'hr_attendance_report.xml', - 'security/ir.model.access.csv' + 'security/ir.model.access.csv', + 'wizard/hr_attendance_bymonth_view.xml', ], 'demo_xml': ['hr_attendance_demo.xml'], 'installable': True, diff --git a/addons/hr_attendance/hr_attendance_wizard.xml b/addons/hr_attendance/hr_attendance_wizard.xml index 7d9c3a47075..b6d4e40dc81 100644 --- a/addons/hr_attendance/hr_attendance_wizard.xml +++ b/addons/hr_attendance/hr_attendance_wizard.xml @@ -6,7 +6,7 @@ - + ). # @@ -15,13 +15,13 @@ # 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 sign_in_out import print_attendance_error from print_byweek import wiz_byweek -from print_bymonth import wiz_bymonth +import hr_attendance_bymonth -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_attendance/wizard/hr_attendance_bymonth.py b/addons/hr_attendance/wizard/hr_attendance_bymonth.py new file mode 100644 index 00000000000..f020f7542ba --- /dev/null +++ b/addons/hr_attendance/wizard/hr_attendance_bymonth.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 time + +from osv import osv, fields + +class hr_attendance_bymonth(osv.osv_memory): + _name = 'hr.attendance.month' + _description = 'Print Monthly Attendance Report' + _columns = { + 'month': fields.selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], + 'Month', required=True), + 'year': fields.integer('Year', required=True) + } + + def print_report(self, cr, uid, ids, context=None): + datas = { + 'ids': [], + 'model': 'hr.employee', + 'form': self.read(cr, uid, ids)[0] + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'hr.attendance.bymonth', + 'datas': datas, + } + + _defaults = { + 'month': lambda * a: time.gmtime()[1], + 'year': lambda * a: time.gmtime()[0], + } +hr_attendance_bymonth() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml b/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml new file mode 100644 index 00000000000..d2e28579875 --- /dev/null +++ b/addons/hr_attendance/wizard/hr_attendance_bymonth_view.xml @@ -0,0 +1,45 @@ + + + + + + Attendance Report Monthly + hr.attendance.month + form + +
+ + + + + + + +