Skip to content

Commit

Permalink
Merge PR #276 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Dec 14, 2023
2 parents 639272a + 0653551 commit c84756f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dms/models/dms_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ def search_panel_select_range(self, field_name, **kwargs):
.with_context(directory_short_name=True)
.search_read(domain, ["display_name", "parent_id"])
)
all_record_ids = [rec["id"] for rec in comodel_records]
field_range = {}
enable_counters = kwargs.get("enable_counters")
for record in comodel_records:
Expand All @@ -313,7 +314,11 @@ def search_panel_select_range(self, field_name, **kwargs):
record_values = {
"id": record_id,
"display_name": record["display_name"],
"parent_id": parent[0] if parent else False,
# If the parent directory is not in all the records we should not
# set parent_id because the user does not have access to parent.
"parent_id": (
parent[0] if parent and parent[0] in all_record_ids else False
),
}
if enable_counters:
record_values["__count"] = 0
Expand Down

0 comments on commit c84756f

Please sign in to comment.