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

« back to all changes in this revision

Viewing changes to hr_skill/wizard/datewise.py

  • Committer: Jay vora
  • Date: 2008-05-20 11:35:25 UTC
  • Revision ID: jvo@tinyerp.com-03a2449166812d882b00fbed4ab6e013486d0833

Show diffs side-by-side

added added

removed removed

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