Skip to content
Snippets Groups Projects
Commit 186713ef authored by Quentin De Paoli's avatar Quentin De Paoli
Browse files

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

bzr revid: qdp-launchpad@tinyerp.com-20110110111533-xwo0j4nkm1de8392
parent e61b9f4e
Branches
Tags
No related merge requests found
......@@ -45,6 +45,10 @@ 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):
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
......
......@@ -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'))
......
......@@ -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"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment