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

« back to all changes in this revision

Viewing changes to account_jasper_report/wizard/journal.py

  • Committer: Albert Cervera i Areny
  • Date: 2011-07-08 00:25:21 UTC
  • Revision ID: albert@nan-tic.com-20110708002521-lbq7213zodri4fnn
[ADD] account_jasper_report: Module with jasper-based accounting reports: Intends to replace the ones in standard 'account' module and 'account_financial_report'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import wizard
 
2
 
 
3
view_form_start = """<?xml version="1.0"?>
 
4
    <form string="Print Journal">
 
5
        <image name="gtk-info" size="64" colspan="2"/>
 
6
        <group colspan="2" col="4">
 
7
            <field name="type" colspan="4"/>
 
8
            <field name="order" colspan="4"/>
 
9
            <field name="start_date"/>
 
10
            <field name="end_date"/>
 
11
            <field name="periods" colspan="4"/>
 
12
            <field name="journals" colspan="4"/>
 
13
        </group>
 
14
    </form>"""
 
15
 
 
16
view_fields_start = {
 
17
    'type': {
 
18
        'string': 'Report', 
 
19
        'type': 'selection', 
 
20
        'selection': [('journal','Journal')], 
 
21
        'default': lambda *a: 'journal', 
 
22
        'required': True 
 
23
    },
 
24
    'order': {
 
25
        'string': 'Order By', 
 
26
        'type': 'selection', 
 
27
        'selection': [
 
28
            ('number','Move Number'),
 
29
            ('date','Move Date'),
 
30
        ], 
 
31
        'default': lambda *a: 'number', 
 
32
        'required': True 
 
33
    },
 
34
    'start_date': { 
 
35
        'string':'Start Date', 
 
36
        'type':'date', 
 
37
    },
 
38
    'end_date': { 
 
39
        'string':'End Date',
 
40
        'type':'date',
 
41
    },
 
42
    'periods': { 
 
43
        'string': 'Periods', 
 
44
        'type': 'many2many',
 
45
        'relation': 'account.period' 
 
46
    },
 
47
    'journals': { 
 
48
        'string': 'Journals', 
 
49
        'type': 'many2many', 
 
50
        'relation': 'account.journal' 
 
51
    }
 
52
}
 
53
 
 
54
class account_report_journal(wizard.interface):
 
55
    states = {
 
56
        'init': {
 
57
            'actions': [],
 
58
            'result': {
 
59
                'type': 'form', 
 
60
                'arch': view_form_start, 
 
61
                'fields': view_fields_start, 
 
62
                'state': [('end','_Cancel','gtk-cancel'),('print','_Print','gtk-ok')]
 
63
            }
 
64
        },
 
65
        'print': {
 
66
            'actions': [],
 
67
            'result': {
 
68
                'type': 'print',
 
69
                'report': 'account.journal', 
 
70
                'state':'end',
 
71
            }
 
72
        }
 
73
    }
 
74
account_report_journal('account_report_journal')
 
75