~openerp-commiter/openobject-addons/trunk-extra-addons

« back to all changes in this revision

Viewing changes to hr_skill/wizard/datewise.py

bugfix in overlay creation system

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- encoding: utf-8 -*-
 
2
import wizard
 
3
import pooler
 
4
import time
 
5
 
 
6
 
 
7
dates_form = '''<?xml version="1.0"?>
 
8
<form string="Select period">
 
9
        <field name="sdate"/>
 
10
        <newline/>
 
11
        <field name="edate"/>
 
12
</form>'''
 
13
 
 
14
dates_fields ={
 
15
    'sdate': {'string':'Start Date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
 
16
    'edate': {'string':'End Date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
 
17
            }
 
18
 
 
19
 
 
20
class datewisecheck(wizard.interface):
 
21
 
 
22
    states = {
 
23
       'init': {
 
24
                    'actions': [],
 
25
                    'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('report','Print')]}
 
26
        },
 
27
        'report': {
 
28
                    'actions': [],
 
29
                    'result': {'type':'print', 'report':'datereport.print', 'state':'end'}
 
30
        }
 
31
    }
 
32
datewisecheck('employee.date.check')
 
33
 
 
34
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
35