self._cr.execute("""SELECT to_char(date_trunc('month', date),'YYYY-MM') as mois, sum(sum(amount))
over ( order by date_trunc('month', date) ) as treso
from account_bank_statement_line
group by date_trunc('month', date)
order by date_trunc('month', date) desc limit 6;""")
tresorerie=self._cr.dictfetchall()
self._cr.execute("""SELECT
(select sum(es.total_amount) as fonds_propres from hr_expense_sheet es, hr_expense e where es.id = e.sheet_id and e.payment_mode='own_account' and es.state!='done') as cca,
(select sum(capital) as capital from hr_employee) as capital;""")
fonds_propres=self._cr.dictfetchall()[0]
self._cr.execute("""SELECT to_char(date_trunc('month', date_due),'YYYY-MM') as mois,
sum(case when type='in_invoice' then residual_company_signed else 0 end ) as f_fournisseur,
sum(case when type='out_invoice' then residual_company_signed else 0 end ) as f_client
from account_invoice
where state!='draft' and state!='paid'
group by date_trunc('month', date_due)
order by date_trunc('month', date_due);""")
factures=self._cr.dictfetchall()
self._cr.execute("""SELECT periode,
sum(montant)
from previ_treso
where periode != 1
group by periode;""")
charges_periode=self._cr.dictfetchall()
self._cr.execute("""SELECT to_char(date_trunc('month', date),'YYYY-MM') as mois,