From 8e3b2aff4e2834c0e41e0c781166cf61f2c1b129 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Wed, 15 Sep 2010 16:10:15 +0530 Subject: [PATCH] [IMP] Acccount: Aged trial balance => add target move field on wizard (still need to update the queries) bzr revid: mra@mra-laptop-20100915104015-ey8o87wbqph32hvu --- addons/account/report/account_aged_partner_balance.py | 7 ++++--- .../account/wizard/account_report_aged_partner_balance.py | 5 ++++- .../wizard/account_report_aged_partner_balance_view.xml | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 119c1edef1a..e3c1e57c532 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -49,6 +49,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header): def set_context(self, objects, data, ids, report_type=None): self.query = data['form'].get('query_line', '') self.direction_selection = data['form'].get('direction_selection', 'past') + self.target_move = data['form'].get('direction_selection', 'past') self.date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d')) if (data['form']['result_selection'] == 'customer' ): self.ACCOUNT_TYPE = ['receivable'] @@ -271,7 +272,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header): for i in t: d['No Partner Defined'] = i[0] history.append(d) - + values = {} if self.direction_selection == 'future': before = False @@ -281,11 +282,11 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header): values['direction'] = before and before[0] or 0.0 elif self.direction_selection == 'past': after = False - if future_past.has_key('No Partner Defined'): + if future_past.has_key('No Partner Defined'): after = [ future_past['No Partner Defined'] ] self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0) values['direction'] = after and after[0] or "" - + for i in range(5): during = False if history[i].has_key('No Partner Defined'): diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py index fb0e404401a..6cf01e62375 100644 --- a/addons/account/wizard/account_report_aged_partner_balance.py +++ b/addons/account/wizard/account_report_aged_partner_balance.py @@ -37,11 +37,14 @@ class account_aged_trial_balance(osv.osv_memory): 'direction_selection': fields.selection([('past','Past'), ('future','Future')], 'Analysis Direction', required=True), + 'target_move': fields.selection([('all', 'All Entries'), + ('posted', 'All Posted Entries')], 'Target Moves', required=True), } _defaults = { 'period_length': 30, 'date_from' : time.strftime('%Y-%m-%d'), 'direction_selection': 'past', + 'target_move': 'all', } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): @@ -61,7 +64,7 @@ class account_aged_trial_balance(osv.osv_memory): context = {} data = self.pre_print_report(cr, uid, ids, data, query_line, context=context) - data['form'].update(self.read(cr, uid, ids, ['period_length', 'direction_selection'])[0]) + data['form'].update(self.read(cr, uid, ids, ['period_length', 'direction_selection', 'target_move'])[0]) period_length = data['form']['period_length'] if period_length<=0: diff --git a/addons/account/wizard/account_report_aged_partner_balance_view.xml b/addons/account/wizard/account_report_aged_partner_balance_view.xml index ad9c90b2e36..9f894f0f670 100644 --- a/addons/account/wizard/account_report_aged_partner_balance_view.xml +++ b/addons/account/wizard/account_report_aged_partner_balance_view.xml @@ -17,6 +17,7 @@ +