Browse Source

[IMP] removed unused journal filtering

pull/689/head
Lorenzo Battistini 11 years ago
committed by Nikos Tsirintanis
parent
commit
bf3d3f9638
  1. 1
      account_financial_report_horizontal/wizard/account_report_balance_sheet.py
  2. 8
      account_financial_report_horizontal/wizard/account_report_common.py
  3. 3
      account_financial_report_horizontal/wizard/account_report_common_view.xml
  4. 1
      account_financial_report_horizontal/wizard/account_report_profit_loss.py

1
account_financial_report_horizontal/wizard/account_report_balance_sheet.py

@ -38,7 +38,6 @@ class account_bs_report(orm.TransientModel):
_defaults={ _defaults={
'display_type': True, 'display_type': True,
'journal_ids': [],
} }
def _print_report(self, cr, uid, ids, data, context=None): def _print_report(self, cr, uid, ids, data, context=None):

8
account_financial_report_horizontal/wizard/account_report_common.py

@ -37,7 +37,6 @@ class account_common_report(orm.TransientModel):
'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True), 'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True),
'period_from': fields.many2one('account.period', 'Start period'), 'period_from': fields.many2one('account.period', 'Start period'),
'period_to': fields.many2one('account.period', 'End period'), 'period_to': fields.many2one('account.period', 'End period'),
'journal_ids': fields.many2many('account.journal', 'account_common_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
'date_from': fields.date("Start Date"), 'date_from': fields.date("Start Date"),
'date_to': fields.date("End Date"), 'date_to': fields.date("End Date"),
'target_move': fields.selection([('posted', 'All Posted Entries'), 'target_move': fields.selection([('posted', 'All Posted Entries'),
@ -98,12 +97,8 @@ class account_common_report(orm.TransientModel):
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 ) fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 )
return fiscalyears and fiscalyears[0] or False return fiscalyears and fiscalyears[0] or False
def _get_all_journal(self, cr, uid, context=None):
return self.pool.get('account.journal').search(cr, uid ,[])
_defaults = { _defaults = {
'fiscalyear_id': _get_fiscalyear, 'fiscalyear_id': _get_fiscalyear,
'journal_ids': _get_all_journal,
'filter': 'filter_no', 'filter': 'filter_no',
'chart_account_id': _get_account, 'chart_account_id': _get_account,
'target_move': 'posted', 'target_move': 'posted',
@ -114,7 +109,6 @@ class account_common_report(orm.TransientModel):
context = {} context = {}
result = {} result = {}
result['fiscalyear'] = 'fiscalyear_id' in data['form'] 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
result['chart_account_id'] = 'chart_account_id' in data['form'] and data['form']['chart_account_id'] or False result['chart_account_id'] = 'chart_account_id' in data['form'] and data['form']['chart_account_id'] or False
if data['form']['filter'] == 'filter_date': if data['form']['filter'] == 'filter_date':
result['date_from'] = data['form']['date_from'] result['date_from'] = data['form']['date_from']
@ -141,7 +135,7 @@ class account_common_report(orm.TransientModel):
data = {} data = {}
data['ids'] = context.get('active_ids', []) data['ids'] = context.get('active_ids', [])
data['model'] = context.get('active_model', 'ir.ui.menu') 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', 'target_move'])[0]
data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move'])[0]
used_context = self._build_contexts(cr, uid, ids, data, context=context) used_context = self._build_contexts(cr, uid, ids, data, context=context)
data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or [] data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
data['form']['used_context'] = used_context data['form']['used_context'] = used_context

3
account_financial_report_horizontal/wizard/account_report_common_view.xml

@ -23,9 +23,6 @@
<field name="period_from" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/> <field name="period_from" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/>
<field name="period_to" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/> <field name="period_to" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/>
</page> </page>
<page string="Journals" name="journal_ids">
<field name="journal_ids" colspan="4" nolabel="1"/>
</page>
</notebook> </notebook>
<separator colspan="4"/> <separator colspan="4"/>
<group col="4" colspan="4"> <group col="4" colspan="4">

1
account_financial_report_horizontal/wizard/account_report_profit_loss.py

@ -36,7 +36,6 @@ class account_pl_report(orm.TransientModel):
_defaults = { _defaults = {
'display_type': True, 'display_type': True,
'journal_ids': [],
'target_move': 'all', 'target_move': 'all',
} }

Loading…
Cancel
Save