[IMP][account_financial_report] Sending Unknown Partner at the end of the report

pull/7/merge
Humberto Arocha 2013-11-24 01:01:43 -05:30
parent 2e4056201f
commit 85c799b4b4
1 changed files with 10 additions and 2 deletions

View File

@ -267,15 +267,23 @@ class account_balance(report_sxw.rml_parse):
self.cr.execute(query)
res_dict = self.cr.dictfetchall()
unknown = False
for det in res_dict:
i,d,c,b = det['balanceinit'], det['debit'], det['credit'], det['balance'],
any([bool(i),bool(d),bool(c),bool(b)]) and res.append({
if not any([i,d,c,b]):
continue
data = {
'partner_name': det['partner_name'],
'balanceinit': i,
'debit': d,
'credit': c,
'balance': b,
})
}
if not det['p_idx']:
unknown = data
continue
res.append(data)
unknown and res.append(unknown)
return res
def _get_analytic_ledger(self, account, ctx={}):