summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2016-04-23 20:50:08 +0200
committerNicolas Lempereur <nle@odoo.com>2016-04-23 20:55:41 +0200
commitb06c3cb1f577a732af62050fa0a722c97bd1b8f5 (patch)
tree23fb454a177cab7d5170c93ebf180d37a019d812
parent23e3be006dee95045d5e5a6fbd0177a073c4e738 (diff)
[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
-rw-r--r--addons/account_extra_reports/report/account_partner_ledger.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/addons/account_extra_reports/report/account_partner_ledger.py b/addons/account_extra_reports/report/account_partner_ledger.py
index 12ddab4e451..2bf1c0ca8ca 100644
--- a/addons/account_extra_reports/report/account_partner_ledger.py
+++ b/addons/account_extra_reports/report/account_partner_ledger.py
@@ -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)