5
report_form = """<?xml version="1.0"?>
6
<form string="Report of cash entries :">
7
<field name="date_start" />
8
<field name="date_stop"/>
13
'date_start': {'string': 'Start date', 'type': 'date'},
14
'date_stop': {'string': 'End date', 'type': 'date'},
17
def _init(self, cr, uid, data, context):
18
today_s = time.strftime('%Y-%m-%d')
19
today = time.strptime(today_s,"%Y-%m-%d")
20
year = time.strftime("%Y",today)
21
month = time.strftime("%m",today)
22
return {'date_start': today_s[:-3]+"-01",
23
'date_stop' : today_s[:-3]+"-"+str(calendar.monthrange(int(year),int(month))[1])}
25
class pos_entry_report(wizard.interface):
27
'init' : {'actions' : [_init],
31
'fields': report_fields,
32
'state': [('end','Cancel','gtk-cancel'),
33
('report', 'Report', 'gtk-ok', True)],
40
'report': 'pos.entry',
46
pos_entry_report('pos.entry_report')