~openerp-community/openobject-addons/taktik

« back to all changes in this revision

Viewing changes to account/wizard/wizard_third_party_ledger.py

  • Committer: Fabien Lydoire
  • Date: 2010-06-18 09:43:14 UTC
  • Revision ID: fl@taktik.be-20100618094314-rsei1ysqf6uwz6nf
added account reports in xls

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    <field name="reconcil"/>
39
39
    <field name="page_split"/>
40
40
    </group>
 
41
    <field name="mode"/>
41
42
    <newline/>
42
43
    <separator string="Filters" colspan="4"/>
43
44
    <field name="state" required="True"/>
81
82
    'page_split':{'string':"One Partner Per Page",'type':'boolean'},
82
83
    'date1': {'string':'        Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
83
84
    'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
 
85
    'mode': {'string': 'Mode',
 
86
             'type': 'selection',
 
87
             'selection': [
 
88
                ('pdf_a4_landscape', 'PDF Landscape'),
 
89
                ('spreadsheet_xls', 'Excel Spreadsheet')
 
90
            ],
 
91
            'default': lambda *a: 'pdf_a4_landscape',
 
92
    },
84
93
}
85
94
 
86
95
 
106
115
        return data['form']
107
116
 
108
117
    def _check(self, cr, uid, data, context):
 
118
        if data['form'].get('mode', 'pdf_a4_landscape') == 'spreadsheet_xls':
 
119
            return 'report_xls'
109
120
        if data['form']['page_split']:
110
121
            return 'report'
111
122
        else:
153
164
        'report_other': {
154
165
            'actions': [_check_state],
155
166
            'result': {'type':'print', 'report':'account.third_party_ledger_other', 'state':'end'}
156
 
        }
157
 
 
 
167
        },
 
168
        'report_xls': {
 
169
            'actions': [_check_state],
 
170
            'result': {'type': 'print',
 
171
                       'report': 'account.third_party_ledger_xls',
 
172
                       'state': 'end'},
 
173
        },
158
174
    }
159
175
wizard_report('account.third_party_ledger.report')
160
176