[REM] Account: Remove query_line arguement from wizard methods
bzr revid: mra@mra-laptop-20101001112206-orqbdit5iaprmwq2
This commit is contained in:
@@ -49,8 +49,8 @@ class account_balance_report(osv.osv_memory):
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['target_move'])[0])
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data}
|
||||
|
||||
|
||||
@@ -55,12 +55,12 @@ class account_aged_trial_balance(osv.osv_memory):
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
res = {}
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['period_length', 'direction_selection'])[0])
|
||||
|
||||
period_length = data['form']['period_length']
|
||||
@@ -70,7 +70,7 @@ class account_aged_trial_balance(osv.osv_memory):
|
||||
raise osv.except_osv(_('UserError'), _('Enter a Start date !'))
|
||||
|
||||
start = datetime.strptime(data['form']['date_from'], "%Y-%m-%d")
|
||||
|
||||
|
||||
if data['form']['direction_selection'] == 'past':
|
||||
for i in range(5)[::-1]:
|
||||
stop = start - relativedelta(days=period_length)
|
||||
|
||||
@@ -57,10 +57,10 @@ class account_bs_report(osv.osv_memory):
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
account = self.pool.get('account.account').browse(cr, uid, data['form']['chart_account_id'])
|
||||
if not account.company_id.property_reserve_and_surplus_account:
|
||||
raise osv.except_osv(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !'))
|
||||
|
||||
@@ -25,8 +25,8 @@ class account_central_journal(osv.osv_memory):
|
||||
_description = 'Account Central Journal'
|
||||
_inherit = "account.common.journal.report"
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'account.central.journal',
|
||||
|
||||
@@ -63,10 +63,10 @@ class account_common_report(osv.osv_memory):
|
||||
if filter == 'filter_period' and fiscalyear_id:
|
||||
start_period = end_period = False
|
||||
cr.execute('''
|
||||
SELECT * FROM (SELECT p.id
|
||||
FROM account_period p
|
||||
LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
|
||||
WHERE f.id = %s
|
||||
SELECT * FROM (SELECT p.id
|
||||
FROM account_period p
|
||||
LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
|
||||
WHERE f.id = %s
|
||||
ORDER BY p.date_start ASC
|
||||
LIMIT 1) AS period_start
|
||||
UNION
|
||||
@@ -134,7 +134,7 @@ class account_common_report(osv.osv_memory):
|
||||
result_initial_bal['date_to'] = (datetime.datetime.strptime(fiscal_date_start, "%Y-%m-%d") + timedelta(days=-1)).strftime('%Y-%m-%d')
|
||||
return result, result_initial_bal
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
raise (_('Error'), _('not implemented'))
|
||||
|
||||
def check_report(self, cr, uid, ids, context=None):
|
||||
@@ -146,11 +146,10 @@ class account_common_report(osv.osv_memory):
|
||||
data['model'] = context.get('active_model', 'ir.ui.menu')
|
||||
data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id'])[0]
|
||||
used_context, used_context_initial_bal = self._build_contexts(cr, uid, ids, data, context=context)
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=used_context)
|
||||
data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
|
||||
data['form']['used_context'] = used_context
|
||||
data['form']['used_context_initial_bal'] = used_context_initial_bal
|
||||
return self._print_report(cr, uid, ids, data, query_line, context=context)
|
||||
return self._print_report(cr, uid, ids, data, context=context)
|
||||
|
||||
account_common_report()
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class account_common_account_report(osv.osv_memory):
|
||||
'display_account': 'bal_all',
|
||||
}
|
||||
|
||||
def pre_print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def pre_print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_account'])[0])
|
||||
|
||||
@@ -38,7 +38,7 @@ class account_common_journal_report(osv.osv_memory):
|
||||
result['periods'] = map(lambda x: x[0], cr.fetchall())
|
||||
return result
|
||||
|
||||
def pre_print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def pre_print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data['form'].update(self.read(cr, uid, ids, ['amount_currency'])[0])
|
||||
|
||||
@@ -39,7 +39,7 @@ class account_common_partner_report(osv.osv_memory):
|
||||
'target_move': 'all'
|
||||
}
|
||||
|
||||
def pre_print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def pre_print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data['form'].update(self.read(cr, uid, ids, ['result_selection', 'target_move'])[0])
|
||||
|
||||
@@ -26,8 +26,8 @@ class account_general_journal(osv.osv_memory):
|
||||
_name = 'account.general.journal'
|
||||
_description = 'Account General Journal'
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'account.general.journal', 'datas': data}
|
||||
|
||||
account_general_journal()
|
||||
|
||||
@@ -49,10 +49,10 @@ class account_report_general_ledger(osv.osv_memory):
|
||||
res['value'] = {'initial_balance': False}
|
||||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby', 'target_move'])[0])
|
||||
if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record
|
||||
data['form'].update({'initial_balance': False})
|
||||
|
||||
@@ -40,10 +40,10 @@ class account_partner_balance(osv.osv_memory):
|
||||
'display_partner': 'non-zero_balance',
|
||||
}
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_partner'])[0])
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
|
||||
@@ -43,10 +43,10 @@ class account_partner_ledger(osv.osv_memory):
|
||||
'page_split': False,
|
||||
}
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'])[0])
|
||||
if data['form']['page_split']:
|
||||
return {
|
||||
|
||||
@@ -38,10 +38,10 @@ class account_print_journal(osv.osv_memory):
|
||||
'target_move': 'all'
|
||||
}
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['sort_selection','target_move'])[0])
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'account.journal.period.print', 'datas': data}
|
||||
|
||||
|
||||
@@ -50,10 +50,10 @@ class account_pl_report(osv.osv_memory):
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_type'])[0])
|
||||
if data['form']['display_type']:
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user