Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions news/SUP-51505.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove bound_licences filter for all licences except RoadDecree and Tickets
[WBoudabous]
13 changes: 1 addition & 12 deletions src/Products/urban/content/licence/CODT_BaseBuildLicence.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,18 +547,7 @@
restrict_browsing_to_startup_directory=True,
label=_("urban_label_bound_licences", default="Bound licences"),
),
allowed_types=[
t
for t in URBAN_TYPES
if t
not in [
"Inspection",
"Ticket",
"ProjectMeeting",
"CODT_UrbanCertificateOne",
"UrbanCertificateOne",
]
],
allowed_types=[t for t in URBAN_TYPES],
schemata="urban_description",
multiValued=True,
relationship="bound_licences",
Expand Down
14 changes: 1 addition & 13 deletions src/Products/urban/content/licence/Inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,7 @@
restrict_browsing_to_startup_directory=True,
label=_("urban_label_bound_licences", default="Bound licences"),
),
allowed_types=[
t
for t in URBAN_TYPES
if t
not in [
"Inspection",
"Ticket",
"ProjectMeeting",
"PatrimonyCertificate",
"CODT_UrbanCertificateOne",
"UrbanCertificateOne",
]
],
allowed_types=[t for t in URBAN_TYPES],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

bound_licences now includes exception types that should remain filtered.

On Line 165, switching to all URBAN_TYPES appears to re-allow RoadDecree/Ticket(s), which conflicts with the PR objective (“except RoadDecree and Tickets”). Please keep those exception types excluded.

Suggested fix pattern
-            allowed_types=[t for t in URBAN_TYPES],
+            allowed_types=[
+                t for t in URBAN_TYPES if t not in EXCLUDED_BOUND_LICENCE_TYPES
+            ],
# define once (shared constant/module), with your exact portal_type ids
EXCLUDED_BOUND_LICENCE_TYPES = {"RoadDecree", "Ticket"}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Products/urban/content/licence/Inspection.py` at line 165, The
bound_licences field was changed to allow all URBAN_TYPES, which inadvertently
re-includes RoadDecree and Ticket; restore the exclusion by updating the
bound_licences configuration to filter URBAN_TYPES minus the exception set
(e.g., define a shared constant EXCLUDED_BOUND_LICENCE_TYPES = {"RoadDecree",
"Ticket"} and use allowed_types=[t for t in URBAN_TYPES if t not in
EXCLUDED_BOUND_LICENCE_TYPES]) so bound_licences continues to exclude those
portal_type ids (refer to bound_licences and URBAN_TYPES in the file).

schemata="urban_description",
multiValued=True,
relationship="bound_licences",
Expand Down
13 changes: 1 addition & 12 deletions src/Products/urban/content/licence/PatrimonyCertificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,7 @@
restrict_browsing_to_startup_directory=True,
label=_("urban_label_bound_licences", default="Bound licences"),
),
allowed_types=[
t
for t in URBAN_TYPES
if t
not in [
"Inspection",
"Ticket",
"ProjectMeeting",
"CODT_UrbanCertificateOne",
"UrbanCertificateOne",
]
],
allowed_types=[t for t in URBAN_TYPES],
schemata="urban_description",
multiValued=True,
relationship="bound_licences",
Expand Down