From cfaff9ab0c29977bc10c71774b8a70aa99915b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Mon, 12 Sep 2022 13:18:38 +0200 Subject: [PATCH] [FIX] flake8 --- openupgradelib/openupgrade.py | 2 +- openupgradelib/openupgrade_90.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py index 75c47092..14143bd9 100644 --- a/openupgradelib/openupgrade.py +++ b/openupgradelib/openupgrade.py @@ -2431,7 +2431,7 @@ def format_message(f): # CONTEXT GROUP BY try: context = safe_eval(f.context, globaldict) - assert(isinstance(context, dict)) + assert isinstance(context, dict) except Exception as e: logger.warning( format_message(f) + diff --git a/openupgradelib/openupgrade_90.py b/openupgradelib/openupgrade_90.py index 42340563..18fdab4f 100644 --- a/openupgradelib/openupgrade_90.py +++ b/openupgradelib/openupgrade_90.py @@ -53,7 +53,8 @@ def convert_binary_field_to_attachment(env, field_spec): last_id = 0 while True: env.cr.execute( - """SELECT id, {0} FROM {1} WHERE {0} IS NOT NULL AND id > {2} + """SELECT id, {0} FROM {1} + WHERE {0} IS NOT NULL AND id > {2} ORDER BY id LIMIT 500; """.format(column, model._table, last_id) )