[FIX] add filter to list on analytic line linked with a general account analytic journal

This commit is contained in:
Vincent Renaville
2013-05-02 15:44:54 +02:00
parent caabefc691
commit add3b7acc6

View File

@@ -36,10 +36,12 @@ class account_hours_block(report_sxw.rml_parse):
def _get_analytic_lines(self, hours_block): def _get_analytic_lines(self, hours_block):
al_pool = self.pool.get('account.analytic.line') 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( al_ids = al_pool.search(
self.cr, self.cr,
self.uid, self.uid,
[('invoice_id', '=', hours_block.invoice_id.id)], [('invoice_id', '=', hours_block.invoice_id.id),('journal_id','in',tcj_ids)],
order='date desc', order='date desc',
context=self.context) context=self.context)
return al_pool.browse(self.cr, self.uid, al_ids, context=self.context) return al_pool.browse(self.cr, self.uid, al_ids, context=self.context)