[FIX] account_extra_reports: None unattended

For the partner ledger report, since LEFT JOIN are used in the request
we could get NULL values which broke the following code.

note: issue reported on 7c6c188
This commit is contained in:
Nicolas Lempereur
2016-04-23 20:55:41 +02:00
parent 23e3be006d
commit b06c3cb1f5
@@ -28,10 +28,9 @@ class ReportPartnerLedger(models.AbstractModel):
sum = 0.0
for r in res:
r['displayed_name'] = '-'.join(
(r['move_name'] not in ['', '/'] and [r['move_name']] or []) +
(r['ref'] not in ['', '/'] and [r['ref']] or []) +
(r['name'] not in ['', '/'] and [r['name']] or [])
)
r[field_name] for field_name in ('move_name', 'ref', 'name')
if r[field_name] not in (None, '', '/')
)
sum += r['debit'] - r['credit']
r['progress'] = sum
full_account.append(r)