Skip to content

Commit

Permalink
Merge pull request OCA#373 from Tecnativa/imp-log-disable_invalid_fil…
Browse files Browse the repository at this point in the history
…ters-probing

[IMP] disable_invalid_filters: log filter probes
  • Loading branch information
pedrobaeza authored Jun 14, 2024
2 parents ca46fca + fb69382 commit 565c58f
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit 565c58f

Please sign in to comment.