self.cr.execute('select a.code, a.name, sum(debit) as debit, sum(credit) as credit from account_move_line l left join account_account a on (l.account_id=a.id) where l.period_id=%d and l.journal_id=%d and l.state<>\'draft\' group by a.id, a.code, a.name',(period_id,journal_id))
returnself.cr.dictfetchall()
def_sum_debit(self,period_id,journal_id):
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'',(period_id,journal_id))
returnself.cr.fetchone()[0]or0.0
def_sum_credit(self,period_id,journal_id):
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'',(period_id,journal_id))