diff --git a/upgrade_analysis/compare.py b/upgrade_analysis/compare.py index 1300f90b9..3222bcd1a 100644 --- a/upgrade_analysis/compare.py +++ b/upgrade_analysis/compare.py @@ -110,7 +110,9 @@ def search(item, item_list, fields, get_all=None): def fieldprint(old, new, field, text, reprs): - fieldrepr = "{} ({})".format(old["field"], old["type"]) + fieldrepr = "{}".format(old["field"]) + if old["field"] not in ("_inherits", "_order"): + fieldrepr += " ({})".format(old["type"]) fullrepr = "{:<12} / {:<24} / {:<30}".format(old["module"], old["model"], fieldrepr) if not text: text = "{} is now '{}' ('{}')".format(field, new[field], old[field]) @@ -244,6 +246,7 @@ def compare_sets(old_records, new_records): "isrelated", "required", "table", + "_order", ], ) @@ -260,6 +263,7 @@ def compare_sets(old_records, new_records): "isrelated", "required", "table", + "_order", ], ) @@ -276,6 +280,7 @@ def compare_sets(old_records, new_records): "isrelated", "required", "table", + "_order", ], ) @@ -289,6 +294,8 @@ def compare_sets(old_records, new_records): "attachment", ] for column in old_records: + if column["field"] == "_order": + continue # we do not care about removed non stored function fields if not column["stored"] and (column["isfunction"] or column["isrelated"]): continue @@ -311,6 +318,8 @@ def compare_sets(old_records, new_records): ] ) for column in new_records: + if column["field"] == "_order": + continue # we do not care about newly added non stored function fields if not column["stored"] and (column["isfunction"] or column["isrelated"]): continue diff --git a/upgrade_analysis/models/upgrade_record.py b/upgrade_analysis/models/upgrade_record.py index 445a90c97..c31b453ea 100644 --- a/upgrade_analysis/models/upgrade_record.py +++ b/upgrade_analysis/models/upgrade_record.py @@ -103,6 +103,7 @@ class UpgradeRecord(models.Model): "hasdefault", "table", "_inherits", + "_order", ] template = {x: False for x in keys} diff --git a/upgrade_analysis/upgrade_log.py b/upgrade_analysis/upgrade_log.py index 84547402f..b102d3afa 100644 --- a/upgrade_analysis/upgrade_log.py +++ b/upgrade_analysis/upgrade_log.py @@ -124,6 +124,7 @@ def log_model(model, local_registry): model_registry = local_registry.setdefault(model._name, {}) if model._inherits: model_registry["_inherits"] = {"_inherits": str(model._inherits)} + model_registry["_order"] = {"_order": model._order} for k, v in model._fields.items(): properties = { "type": typemap.get(v.type, v.type),