Browse Source

[ADD] ready list of account

pull/7/merge
Yanina Aular 12 years ago
parent
commit
fa81a67363
  1. 34
      account_financial_report/report/parser.py

34
account_financial_report/report/parser.py

@ -434,22 +434,44 @@ class account_balance(report_sxw.rml_parse):
account_ids_black = account_obj.search(self.cr, self.uid, ([('id', 'in', [i[0] for i in account_ids]),('type','not in',('view','consolidation'))])) account_ids_black = account_obj.search(self.cr, self.uid, ([('id', 'in', [i[0] for i in account_ids]),('type','not in',('view','consolidation'))]))
account_ids_black = account_obj.browse(self.cr, self.uid, account_ids_black) account_ids_black = account_obj.browse(self.cr, self.uid, account_ids_black)
account_ids_black.sort(key=lambda x: x.level)
account_ids_black.reverse()
account_ids_not_black = account_obj.search(self.cr, self.uid, ([('id', 'in', [i[0] for i in account_ids]),('type','in',('view','consolidation'))])) account_ids_not_black = account_obj.search(self.cr, self.uid, ([('id', 'in', [i[0] for i in account_ids]),('type','in',('view','consolidation'))]))
account_ids_not_black = account_obj.browse(self.cr, self.uid, account_ids_not_black) account_ids_not_black = account_obj.browse(self.cr, self.uid, account_ids_not_black)
account_ids_not_black.sort(key=lambda x: x.level) account_ids_not_black.sort(key=lambda x: x.level)
account_ids_not_black.reverse() account_ids_not_black.reverse()
black = []
print "Negros" print "Negros"
for i in account_ids_black: for i in account_ids_black:
print i.name
print i.level
black_data = {}
black_data['obj'] = i
black_data['debit'] = i.debit
black_data['credit'] = i.credit
black_data['balance'] = i.balance
black_data['parent_id'] = i.parent_id
#print i.name
#print i.level
#print black_data
black.append(black_data)
not_black = []
print "No Negros" print "No Negros"
for i in account_ids_not_black: for i in account_ids_not_black:
print i.name
print i.level
not_black_data = {}
not_black_data['obj'] = i
not_black_data['debit'] = i.debit
not_black_data['credit'] = i.credit
not_black_data['balance'] = i.balance
not_black_data['parent_id'] = i.parent_id
#print i.name
#print i.level
not_black.append(not_black_data)
#import pdb
#pdb.set_trace()
start_time = time.clock() start_time = time.clock()
for aa_id in account_ids: for aa_id in account_ids:

Loading…
Cancel
Save