~openerp-mexico-team-activo/openerp-mexico-localization/l10n_mx_hr_payroll

« back to all changes in this revision

Viewing changes to hr_clothes_uniforms/wizard/hr_summary_clothes.py

  • Committer: echeverrifm at gmail
  • Date: 2012-06-21 16:59:15 UTC
  • Revision ID: echeverrifm@gmail.com-20120621165915-vi0mdyt5xu4ncdo0
[REF] Modify name of modules l10n_mx_hr_XXXXXXXX

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
##############################################################################
3
 
#
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 $
7
 
#
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.
12
 
#
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.
17
 
#
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/>.
20
 
#
21
 
##############################################################################
22
 
import time
23
 
 
24
 
from osv import osv, fields
25
 
from tools.translate import _
26
 
 
27
 
class hr_clothes_work_summary(osv.osv_memory):
28
 
    _name = 'hr.clothes_work.summary'
29
 
    _description = 'HR Work Clothes Summary Report'
30
 
    _columns = {
31
 
        'date_from': fields.date('From', required=True),
32
 
        'depts': fields.many2many('hr.department', 'summary_dept_rel', 'sum_id', 'dept_id', 'Department(s)'),
33
 
    }
34
 
 
35
 
    _defaults = {
36
 
         'date_from': lambda *a: time.strftime('%Y-%m-01'),
37
 
    }
38
 
 
39
 
    def print_report(self, cr, uid, ids, context=None):
40
 
        data = self.read(cr, uid, ids, [], context=context)[0]
41
 
        if not data['depts']:
42
 
            raise osv.except_osv(_('Error'), _('You have to select at least 1 Department. And try again'))
43
 
        datas = {
44
 
             'ids': [],
45
 
             'model': 'ir.ui.menu',
46
 
             'form': data
47
 
            }
48
 
        return {
49
 
            'type': 'ir.actions.report.xml',
50
 
            'report_name': 'holidays.summary',
51
 
            'datas': datas,
52
 
            }
53
 
 
54
 
hr_clothes_work_summary()
55
 
 
56
 
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: