From 0787f3f0c3ec8099ed652639a2fb530e151d0cf4 Mon Sep 17 00:00:00 2001 From: Humberto Arocha Date: Wed, 19 Jun 2013 20:14:23 -0530 Subject: [PATCH] [IMP] All accounts are for all reports --- account_financial_report/report/parser.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/account_financial_report/report/parser.py b/account_financial_report/report/parser.py index 3377b899..b1d5218f 100644 --- a/account_financial_report/report/parser.py +++ b/account_financial_report/report/parser.py @@ -443,6 +443,17 @@ class account_balance(report_sxw.rml_parse): [('id', 'in', [i[0] for i in account_ids]), ('type', 'not in', ('view', 'consolidation'))])) + + account_not_black_ids = account_obj.search(self.cr, self.uid, ([('id', 'in', [ + i[0] for i in account_ids]), ('type', 'in', ('view', 'consolidation'))])) + + #This could be done quickly with a sql sentence + account_not_black = account_obj.browse( + self.cr, self.uid, account_not_black_ids, ctx_to_use) + account_not_black.sort(key=lambda x: x.level) + account_not_black.reverse() + account_not_black_ids = [i.id for i in account_not_black] + all_account_period = {} # todas las cuentas por periodo if form['columns'] == 'thirteen': for p_act in range(0, 13): @@ -465,14 +476,6 @@ class account_balance(report_sxw.rml_parse): account_black_init = account_obj.browse( self.cr, self.uid, account_black_ids, ctx_i) - account_not_black_ids = account_obj.search(self.cr, self.uid, ([('id', 'in', [ - i[0] for i in account_ids]), ('type', 'in', ('view', 'consolidation'))])) - account_not_black = account_obj.browse( - self.cr, self.uid, account_not_black_ids, ctx_to_use) - account_not_black.sort(key=lambda x: x.level) - account_not_black.reverse() - account_not_black_ids = [i.id for i in account_not_black] - #~ Negros dict_black = {} for i in account_black: