From add3b7acc6add95bc3335fed74a684fd5dd54fcc Mon Sep 17 00:00:00 2001 From: Vincent Renaville Date: Thu, 2 May 2013 15:44:54 +0200 Subject: [PATCH] [FIX] add filter to list on analytic line linked with a general account analytic journal --- analytic_hours_block/report/hours_block.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/analytic_hours_block/report/hours_block.py b/analytic_hours_block/report/hours_block.py index 8807ad51..fee9fbac 100644 --- a/analytic_hours_block/report/hours_block.py +++ b/analytic_hours_block/report/hours_block.py @@ -36,10 +36,12 @@ class account_hours_block(report_sxw.rml_parse): def _get_analytic_lines(self, hours_block): al_pool = self.pool.get('account.analytic.line') + aj_pool = self.pool.get('account.analytic.journal') + tcj_ids = aj_pool.search(self.cr,self.uid,[('type','=','general')]) al_ids = al_pool.search( self.cr, self.uid, - [('invoice_id', '=', hours_block.invoice_id.id)], + [('invoice_id', '=', hours_block.invoice_id.id),('journal_id','in',tcj_ids)], order='date desc', context=self.context) return al_pool.browse(self.cr, self.uid, al_ids, context=self.context)