[IMP] account: more refactoring on wizards (filter on journal)
bzr revid: qdp-launchpad@tinyerp.com-20100706121344-slqpt2hau5tngm7s
This commit is contained in:
parent
ff92140c6c
commit
d7c1d75c87
|
@ -62,6 +62,9 @@ class account_move_line(osv.osv):
|
|||
else:
|
||||
query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s %s)" % (fiscalyear_clause,where_move_state,where_move_lines_by_date)
|
||||
|
||||
if context.get('journal_ids', False):
|
||||
query += ' AND '+obj+'.journal_id in (%s)' % ','.join(map(str, context['journal_ids']))
|
||||
|
||||
if context.get('period_manner','') == 'created':
|
||||
#the query have to be build with no reference to periods but thanks to the creation date
|
||||
if context.get('periods',False):
|
||||
|
|
|
@ -59,7 +59,7 @@ class account_balance_report(osv.osv_memory):
|
|||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_account',])[0])
|
||||
data['form']['query_line'] = query_line + ' AND l.journal_id in (%s)' % ','.join(map(str, data['form']['journal_ids']))
|
||||
data['form']['query_line'] = query_line
|
||||
return { 'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data, 'nodestroy':True, }
|
||||
|
||||
account_balance_report()
|
||||
|
|
|
@ -88,7 +88,8 @@ class account_common_report(osv.osv_memory):
|
|||
context = {}
|
||||
result = {}
|
||||
period_obj = self.pool.get('account.period')
|
||||
result['fiscalyear'] = data['form']['fiscalyear_id'] and data['form']['fiscalyear_id'] or False
|
||||
result['fiscalyear'] = 'fiscalyear_id' in data['form'] and data['form']['fiscalyear_id'] or False
|
||||
result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
|
||||
if data['form']['filter'] == 'filter_date':
|
||||
result['date_from'] = data['form']['date_from']
|
||||
result['date_to'] = data['form']['date_to']
|
||||
|
|
Loading…
Reference in New Issue