From 8aa6aa0c785b006a11b702d6052745d87b058902 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 6 May 2015 18:17:45 +0200 Subject: [PATCH 1/2] [FIX] account: entries analysis with null values in debit/credit In SQL, the addition/subtraction between NULL and an integer/numeric returns NULL. Therefore, if either debit or credit was set to null instead of 0.0, debit-credit returned null, instead of the actual subtraction opw-634044 --- addons/account/report/account_entries_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py index 6dd451599b4..0520a16c64a 100644 --- a/addons/account/report/account_entries_report.py +++ b/addons/account/report/account_entries_report.py @@ -145,7 +145,7 @@ class account_entries_report(osv.osv): l.amount_currency as amount_currency, l.debit as debit, l.credit as credit, - l.debit-l.credit as balance + coalesce(l.debit, 0.0) - coalesce(l.credit, 0.0) as balance from account_move_line l left join account_account a on (l.account_id = a.id) From f300d648a87a9be76761a97acfe2061a32adcd8f Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 4 May 2015 12:01:49 +0200 Subject: [PATCH 2/2] [FIX] web: attachment with safari With Safari, the function content_disposition must return "attachment; filename=\"%s\"" % filename to avoid that Werkzeug raises an UnicodeDecodeError. Fixes #6160 opw:634205 --- addons/web/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 080025dd737..7d3862c3091 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -527,7 +527,7 @@ def content_disposition(filename, req): if browser == 'msie' and version < 9: return "attachment; filename=%s" % escaped elif browser == 'safari': - return "attachment; filename=%s" % filename + return "attachment; filename=\"%s\"" % filename else: return "attachment; filename*=UTF-8''%s" % escaped