Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] disable_invalid_filters: log filter probes #373

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -2743,7 +2743,7 @@ def delete_record_translations(cr, module, xml_ids, field_list=None):


# flake8: noqa: C901
def disable_invalid_filters(env):
def disable_invalid_filters(env, verbose=True):
"""It analyzes all the existing active filters to check if they are still
correct. If not, they are disabled for avoiding errors when clicking on
them, or worse, if they are default filters when opening the model/action.
Expand Down Expand Up @@ -2785,6 +2785,13 @@ def format_message(f):
if f.model_id not in env:
continue # Obsolete or invalid model
model = env[f.model_id]
if verbose:
logger.info(
"Checking filter '%s' on model %s with domain %s",
f.name,
model._name,
f.domain,
)
try:
columns = model._fields
except AttributeError:
Expand Down
Loading