From ba90f3622382368bca6f7190ab13e43f909f8c6c Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 6 Oct 2014 09:12:35 +0200 Subject: [PATCH 1/3] [IMP] Performance fix on last_rec_date initialization --- .../migrations/7.0.1.0.2/post-migration.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py b/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py index aae75607..a562adca 100644 --- a/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py +++ b/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py @@ -27,15 +27,13 @@ def migrate(cr, version): " SET last_rec_date =" " (SELECT date from account_move_line" " WHERE reconcile_id = acm.reconcile_id" - " AND reconcile_id IS NOT NULL" " ORDER BY date DESC LIMIT 1)" - " WHERE last_rec_date is null;") + " WHERE last_rec_date IS NULL AND reconcile_id IS NOT NULL;") cr.execute("UPDATE account_move_line as acm " " SET last_rec_date =" " (SELECT date from account_move_line" " WHERE reconcile_partial_id" " = acm.reconcile_partial_id" - " AND reconcile_partial_id IS NOT NULL" " ORDER BY date DESC LIMIT 1)" - " WHERE last_rec_date is null;") + " WHERE last_rec_date IS NULL AND reconcile_partial_id IS NOT NULL;") From 5200c50436150f7825be9050f46a1cf3c3963a62 Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 6 Oct 2014 10:29:32 +0200 Subject: [PATCH 2/3] [FIX] Pep8 --- .../migrations/7.0.1.0.2/post-migration.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py b/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py index a562adca..53cc6106 100644 --- a/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py +++ b/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py @@ -28,7 +28,8 @@ def migrate(cr, version): " (SELECT date from account_move_line" " WHERE reconcile_id = acm.reconcile_id" " ORDER BY date DESC LIMIT 1)" - " WHERE last_rec_date IS NULL AND reconcile_id IS NOT NULL;") + " WHERE last_rec_date IS NULL" + " AND reconcile_id IS NOT NULL;") cr.execute("UPDATE account_move_line as acm " " SET last_rec_date =" @@ -36,4 +37,5 @@ def migrate(cr, version): " WHERE reconcile_partial_id" " = acm.reconcile_partial_id" " ORDER BY date DESC LIMIT 1)" - " WHERE last_rec_date IS NULL AND reconcile_partial_id IS NOT NULL;") + " WHERE last_rec_date IS NULL" + " AND reconcile_partial_id IS NOT NULL;") From 8732d4235eb820738e4a29233da89fa642202625 Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 6 Oct 2014 10:40:39 +0200 Subject: [PATCH 3/3] [FIX] Pep8 - changed tabs for spaces --- .../migrations/7.0.1.0.2/post-migration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py b/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py index 53cc6106..6235e060 100644 --- a/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py +++ b/account_financial_report_webkit/migrations/7.0.1.0.2/post-migration.py @@ -29,7 +29,7 @@ def migrate(cr, version): " WHERE reconcile_id = acm.reconcile_id" " ORDER BY date DESC LIMIT 1)" " WHERE last_rec_date IS NULL" - " AND reconcile_id IS NOT NULL;") + " AND reconcile_id IS NOT NULL;") cr.execute("UPDATE account_move_line as acm " " SET last_rec_date =" @@ -38,4 +38,4 @@ def migrate(cr, version): " = acm.reconcile_partial_id" " ORDER BY date DESC LIMIT 1)" " WHERE last_rec_date IS NULL" - " AND reconcile_partial_id IS NOT NULL;") + " AND reconcile_partial_id IS NOT NULL;")