Skip to content

Commit 7121999

Browse files
committed
fix(spp_statistic): fix unreachable privacy service delegation
Empty recordsets in Odoo are falsy, so checking `if privacy_service:` would always evaluate to False even when the model is installed. Changed to `if privacy_service is not None:` to correctly detect when the spp.metrics.privacy model is available.
1 parent d70ce28 commit 7121999

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

spp_statistic/models/statistic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def apply_suppression(self, value, count=None, context=None):
267267

268268
# Delegate to unified privacy service
269269
privacy_service = self.env.get("spp.metrics.privacy")
270-
if privacy_service:
270+
if privacy_service is not None:
271271
stat_config = {"minimum_count": min_count, "suppression_display": display_mode}
272272
return privacy_service.suppress_value(value, count, stat_config=stat_config)
273273

0 commit comments

Comments
 (0)