From 5539019f6a115519e4d11968d7f64a1a9d8216e2 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 14 Nov 2008 15:07:02 +0530 Subject: [PATCH] removed bug from charts of account: it did not open lines for consolidated tree with different accounts which does not comes in its range of parent_left bzr revid: mra@tinyerp.com-20081114093702-ed0bmk6momj3h6r7 --- addons/account/account.py | 7 +++++++ addons/account/wizard/wizard_move_line_select.py | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 37bf0fc2023..f3be0d159ab 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -154,6 +154,13 @@ class account_account(osv.osv): args[pos] = ('id','in',ids1) pos+=1 + if context and context.has_key('consolidate_childs'): #add concolidated childs of accounts + ids = super(account_account,self).search(cr, uid, args, offset, limit, + order, context=context, count=count) + for consolidate_child in self.browse(cr, uid, context['account_id']).child_consol_ids: + ids.append(consolidate_child.id) + return ids + return super(account_account,self).search(cr, uid, args, offset, limit, order, context=context, count=count) diff --git a/addons/account/wizard/wizard_move_line_select.py b/addons/account/wizard/wizard_move_line_select.py index 645d9f90b84..64c80a8ec8d 100644 --- a/addons/account/wizard/wizard_move_line_select.py +++ b/addons/account/wizard/wizard_move_line_select.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -27,6 +27,7 @@ class wizard_move_line_select(wizard.interface): def _open_window(self, cr, uid, data, context): mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data') act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window') + account_obj = pooler.get_pool(cr.dbname).get('account.account') fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') if not context.get('fiscalyear', False): @@ -48,6 +49,10 @@ class wizard_move_line_select(wizard.interface): 'fiscalyear': context.get('fiscalyear', False), 'account_id': data['id'] } + if data['id']: + acc_data = account_obj.browse(cr, uid, data['id']).child_consol_ids + if acc_data: + result['context'].update({'consolidate_childs': True}) result['domain']=result['domain'][0:-1]+','+domain+result['domain'][-1] return result