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

« back to all changes in this revision

Viewing changes to account_jasper_report/wizard/trial_balance.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="start_date"/>
 
9
                        <field name="end_date"/>
 
10
                        <field name="accounts" colspan="4"/>
 
11
                        <field name="periods" colspan="4"/>
 
12
                        <field name="accumulated_periods" colspan="4"/>
 
13
                </group>
 
14
        </form>"""
 
15
 
 
16
view_fields_start = {
 
17
        'type': {
 
18
        'string': 'Report', 
 
19
        'type': 'selection', 
 
20
        'selection': [('trial-balance','Trial Balance')], 
 
21
        'default': lambda *a: 'trial-balance', 
 
22
        'required': True 
 
23
    },
 
24
        'start_date': {
 
25
        'string': 'Start Date', 
 
26
        'type':'date', 
 
27
    },
 
28
        'end_date': {
 
29
        'string': 'End Date',
 
30
        'type':'date', 
 
31
    },
 
32
        'periods': {
 
33
        'string': 'Periods',
 
34
        'type': 'many2many',
 
35
        'relation': 'account.period'
 
36
    },
 
37
        'accounts': {
 
38
        'string': 'Accounts', 
 
39
        'type': 'many2many', 
 
40
        'relation': 'account.account' 
 
41
    },
 
42
        'accumulated_periods': {
 
43
        'string': 'Accumultated Periods', 
 
44
        'type': 'many2many', 
 
45
        'relation': 'account.period' 
 
46
    },
 
47
}
 
48
 
 
49
 
 
50
class account_report_trial_balance(wizard.interface):
 
51
        states = {
 
52
                'init': {
 
53
                        'actions': [],
 
54
                        'result': {
 
55
                                'type': 'form', 
 
56
                                'arch': view_form_start, 
 
57
                                'fields': view_fields_start, 
 
58
                                'state': [('end','Cancel','gtk-cancel'),('print','Print','gtk-ok')]
 
59
                        }
 
60
                },
 
61
                'print': {
 
62
                        'actions': [],
 
63
                        'result': {
 
64
                                'type': 'print', 
 
65
                                'report': 'account.trial.balance', 
 
66
                                'state':'end'
 
67
                        }
 
68
                }
 
69
        }
 
70
account_report_trial_balance('account_report_trial_balance')