[FIX] account: use field taget_move for generation of account financial report (all entires or all posted entries)

lp bug: https://launchpad.net/bugs/1078146 fixed
lp bug: https://launchpad.net/bugs/1135349 fixed

bzr revid: mat@openerp.com-20130902120450-k0gqnclqhgq8nbe6
This commit is contained in:
Martin Trigaux 2013-09-02 14:04:50 +02:00
commit 108936286e
3 changed files with 14 additions and 2 deletions

View File

@ -38,6 +38,7 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
'get_filter': self._get_filter,
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'get_target_move': self._get_target_move,
})
self.context = context

View File

@ -166,11 +166,12 @@
<para style="Standard">
<font color="white"> </font>
</para>
<blockTable colWidths="163.0,163.0,163.0" style="Table2_header">
<blockTable colWidths="122.0,122.0,122.0,122.0" style="Table2_header">
<tr>
<td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filters' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -197,6 +198,10 @@
</tr>
</blockTable>
</td>
<td>
<para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
</td>
</tr>
</blockTable>
<para style="Standard">

View File

@ -54,6 +54,11 @@ class accounting_report(osv.osv_memory):
'target_move': 'posted',
'account_report_id': _get_account_report,
}
def _build_contexts(self, cr, uid, ids, data, context=None):
result = super(accounting_report, self)._build_contexts(cr, uid, ids,data, context=context)
result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
return result
def _build_comparison_context(self, cr, uid, ids, data, context=None):
if context is None:
@ -62,6 +67,7 @@ class accounting_report(osv.osv_memory):
result['fiscalyear'] = 'fiscalyear_id_cmp' in data['form'] and data['form']['fiscalyear_id_cmp'] 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['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
if data['form']['filter_cmp'] == 'filter_date':
result['date_from'] = data['form']['date_from_cmp']
result['date_to'] = data['form']['date_to_cmp']
@ -86,7 +92,7 @@ class accounting_report(osv.osv_memory):
return res
def _print_report(self, cr, uid, ids, data, context=None):
data['form'].update(self.read(cr, uid, ids, ['date_from_cmp', 'debit_credit', 'date_to_cmp', 'fiscalyear_id_cmp', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter'], context=context)[0])
data['form'].update(self.read(cr, uid, ids, ['date_from_cmp', 'debit_credit', 'date_to_cmp', 'fiscalyear_id_cmp', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter','target_move'], context=context)[0])
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.financial.report',