[FIX] account, aged balance report: removed fiscalyear filter and field from the query and wizard

bzr revid: qdp-launchpad@tinyerp.com-20110110111533-xwo0j4nkm1de8392
This commit is contained in:
qdp-launchpad@tinyerp.com 2011-01-10 12:15:33 +01:00
parent e61b9f4e8c
commit 186713ef9d
3 changed files with 8 additions and 3 deletions

View File

@ -45,7 +45,11 @@ class account_move_line(osv.osv):
if context.get('company_id', False):
company_clause = " AND " +obj+".company_id = %s" % context.get('company_id', False)
if not context.get('fiscalyear', False):
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')])
if context.get('all_fiscalyear', False):
#this option is needed by the aged balance report because otherwise, if we search only the draft ones, an open invoice of a closed fiscalyear won't be displayed
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [])
else:
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')])
else:
#for initial balance as well as for normal query, we check only the selected FY because the best practice is to generate the FY opening entries
fiscalyear_ids = [context['fiscalyear']]

View File

@ -45,7 +45,9 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
def set_context(self, objects, data, ids, report_type=None):
obj_move = self.pool.get('account.move.line')
self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
ctx = data['form'].get('used_context', {})
ctx.update({'fiscalyear': False, 'all_fiscalyear': True})
self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx)
self.direction_selection = data['form'].get('direction_selection', 'past')
self.target_move = data['form'].get('target_move', 'all')
self.date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d'))

View File

@ -13,7 +13,6 @@
<label colspan="4" nolabel="1" string="Aged Partner Balance is a more detailed report of your receivables by intervals. When opening that report, OpenERP asks for the name of the company, the fiscal period and the size of the interval to be analyzed (in days). OpenERP then calculates a table of credit balance by period. So if you request an interval of 30 days OpenERP generates an analysis of creditors for the past month, past two months, and so on. "/>
<newline/>
<field name="chart_account_id" widget='selection'/>
<field name="fiscalyear_id"/>
<newline/>
<field name="date_from"/>
<field name="period_length"/>