1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6
# $Id: account.py 1005 2005-07-25 08:41:42Z nicoe $
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU Affero General Public License as
10
# published by the Free Software Foundation, either version 3 of the
11
# License, or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU Affero General Public License for more details.
18
# You should have received a copy of the GNU Affero General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
24
from osv import osv, fields
25
from tools.translate import _
27
class hr_clothes_work_summary(osv.osv_memory):
28
_name = 'hr.clothes_work.summary'
29
_description = 'HR Work Clothes Summary Report'
31
'date_from': fields.date('From', required=True),
32
'depts': fields.many2many('hr.department', 'summary_dept_rel', 'sum_id', 'dept_id', 'Department(s)'),
36
'date_from': lambda *a: time.strftime('%Y-%m-01'),
39
def print_report(self, cr, uid, ids, context=None):
40
data = self.read(cr, uid, ids, [], context=context)[0]
42
raise osv.except_osv(_('Error'), _('You have to select at least 1 Department. And try again'))
45
'model': 'ir.ui.menu',
49
'type': 'ir.actions.report.xml',
50
'report_name': 'holidays.summary',
54
hr_clothes_work_summary()
56
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: