[IMP] Account: Remove duplication method on account object

bzr revid: mra@mra-laptop-20100819041022-dduf8v6qmc40rpsr
This commit is contained in:
Mustufa Rangwala 2010-08-19 09:40:22 +05:30
parent b46aedf80c
commit e956c42cd9
1 changed files with 6 additions and 17 deletions

View File

@ -197,19 +197,6 @@ class account_account(osv.osv):
_parent_store = True
logger = netsvc.Logger()
def _get_children_and_consol(self, cr, uid, ids, context={}):
ids2=[]
temp=[]
read_data= self.read(cr, uid, ids,['id','child_id'], context)
for data in read_data:
ids2.append(data['id'])
if data['child_id']:
temp=[]
for x in data['child_id']:
temp.append(x)
ids2 += self._get_children_and_consol(cr, uid, temp, context)
return ids2
def search(self, cr, uid, args, offset=0, limit=None, order=None,
context=None, count=False):
if context is None:
@ -244,7 +231,9 @@ class account_account(osv.osv):
return super(account_account, self).search(cr, uid, args, offset, limit,
order, context=context, count=count)
def _get_children_and_consol(self, cr, uid, ids, context={}):
def _get_children_and_consol(self, cr, uid, ids, context=None):
if context is None:
context = {}
#this function search for all the children and all consolidated children (recursively) of the given account ids
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)
ids3 = []