Skip to content

Commit 14678f3

Browse files
committed
merge: resolve conflicts with 19.0 (spp_statistic renamed to spp_indicator)
Accept 19.0 versions of spp_indicator/tests/__init__.py and spp_indicator/tests/test_coverage.py since spp_statistic was renamed to spp_indicator on the main branch.
2 parents 548b559 + 9c2376e commit 14678f3

File tree

141 files changed

+2790
-1372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+2790
-1372
lines changed

spp_aggregation/security/ir.model.access.csv

Lines changed: 0 additions & 7 deletions
This file was deleted.

spp_aggregation/static/description/index.html

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
==========================
2-
OpenSPP Aggregation Engine
3-
==========================
1+
=================
2+
OpenSPP Analytics
3+
=================
44

55
..
66
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -17,7 +17,7 @@ OpenSPP Aggregation Engine
1717
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1818
:alt: License: LGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OpenSPP%2FOpenSPP2-lightgray.png?logo=github
20-
:target: https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_aggregation
20+
:target: https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_analytics
2121
:alt: OpenSPP/OpenSPP2
2222

2323
|badge1| |badge2| |badge3|
@@ -121,7 +121,7 @@ Bug Tracker
121121
Bugs are tracked on `GitHub Issues <https://github.com/OpenSPP/OpenSPP2/issues>`_.
122122
In case of trouble, please check there if your issue has already been reported.
123123
If you spotted it first, help us to smash it by providing a detailed and welcomed
124-
`feedback <https://github.com/OpenSPP/OpenSPP2/issues/new?body=module:%20spp_aggregation%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
124+
`feedback <https://github.com/OpenSPP/OpenSPP2/issues/new?body=module:%20spp_analytics%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
125125

126126
Do not contact contributors directly about support or help with technical issues.
127127

@@ -144,6 +144,6 @@ Current maintainer:
144144

145145
|maintainer-jeremi|
146146

147-
This module is part of the `OpenSPP/OpenSPP2 <https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_aggregation>`_ project on GitHub.
147+
This module is part of the `OpenSPP/OpenSPP2 <https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_analytics>`_ project on GitHub.
148148

149149
You are welcome to contribute.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Part of OpenSPP. See LICENSE file for full copyright and licensing details.
22
{
3-
"name": "OpenSPP Aggregation Engine",
4-
"summary": "Unified aggregation service for statistics, simulations, and GIS queries",
3+
"name": "OpenSPP Analytics",
4+
"summary": "Query engine for indicators, simulations, and GIS analytics",
55
"category": "OpenSPP",
66
"version": "19.0.2.0.0",
77
"sequence": 1,
@@ -16,7 +16,7 @@
1616
"spp_area",
1717
"spp_registry",
1818
"spp_security",
19-
"spp_metrics_services",
19+
"spp_metric_service",
2020
],
2121
"data": [
2222
# Security
@@ -25,8 +25,8 @@
2525
# Data
2626
"data/cron_cache_cleanup.xml",
2727
# Views
28-
"views/aggregation_scope_views.xml",
29-
"views/aggregation_access_views.xml",
28+
"views/analytics_scope_views.xml",
29+
"views/analytics_access_views.xml",
3030
"views/menu.xml",
3131
],
3232
"assets": {},

spp_aggregation/data/cron_cache_cleanup.xml renamed to spp_analytics/data/cron_cache_cleanup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<odoo noupdate="1">
33
<!-- Cron job to clean up expired cache entries -->
44
<record id="ir_cron_cache_cleanup" model="ir.cron">
5-
<field name="name">Aggregation: Cache Cleanup</field>
6-
<field name="model_id" ref="model_spp_aggregation_cache_entry" />
5+
<field name="name">Analytics: Cache Cleanup</field>
6+
<field name="model_id" ref="model_spp_analytics_cache_entry" />
77
<field name="state">code</field>
88
<field name="code">model.cron_cleanup_expired()</field>
99
<field name="interval_number">1</field>
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Part of OpenSPP. See LICENSE file for full copyright and licensing details.
22

3-
from . import aggregation_scope
4-
from . import aggregation_access
3+
from . import analytics_scope
4+
from . import analytics_access
55
from . import service_scope_resolver
66
from . import service_cache
7-
from . import statistic_registry
7+
from . import indicator_registry
88
from . import service_aggregation

spp_aggregation/models/aggregation_access.py renamed to spp_analytics/models/analytics_access.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_logger = logging.getLogger(__name__)
88

99

10-
class AggregationAccessRule(models.Model):
10+
class AnalyticsAccessRule(models.Model):
1111
"""
1212
Access control rules for aggregation queries.
1313
@@ -18,7 +18,7 @@ class AggregationAccessRule(models.Model):
1818
Also controls k-anonymity thresholds and scope restrictions.
1919
"""
2020

21-
_name = "spp.aggregation.access.rule"
21+
_name = "spp.analytics.access.rule"
2222
_description = "Aggregation Access Rule"
2323
_order = "sequence, name"
2424

@@ -101,7 +101,7 @@ class AggregationAccessRule(models.Model):
101101
),
102102
)
103103
allowed_scope_ids = fields.Many2many(
104-
comodel_name="spp.aggregation.scope",
104+
comodel_name="spp.analytics.scope",
105105
relation="spp_aggregation_access_rule_scope_rel",
106106
column1="rule_id",
107107
column2="scope_id",
@@ -184,7 +184,7 @@ def get_effective_rule_for_user(self, user=None):
184184
185185
:param user: res.users record (defaults to current user)
186186
:returns: Access rule record or None if no rule matches
187-
:rtype: spp.aggregation.access.rule or None
187+
:rtype: spp.analytics.access.rule or None
188188
"""
189189
user = user or self.env.user
190190

@@ -209,7 +209,7 @@ def check_scope_allowed(self, scope):
209209
"""
210210
Check if a scope is allowed under this rule.
211211
212-
:param scope: spp.aggregation.scope record or dict for inline scope
212+
:param scope: spp.analytics.scope record or dict for inline scope
213213
:returns: True if allowed
214214
:raises: ValidationError if not allowed
215215
"""

spp_aggregation/models/aggregation_scope.py renamed to spp_analytics/models/analytics_scope.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
_logger = logging.getLogger(__name__)
99

1010

11-
class AggregationScope(models.Model):
11+
class AnalyticsScope(models.Model):
1212
"""
1313
Unified targeting scope for aggregation queries.
1414
@@ -21,7 +21,7 @@ class AggregationScope(models.Model):
2121
- Explicit ID lists
2222
"""
2323

24-
_name = "spp.aggregation.scope"
24+
_name = "spp.analytics.scope"
2525
_description = "Aggregation Scope"
2626
_order = "name"
2727

@@ -170,7 +170,7 @@ def _compute_registrant_count(self):
170170
else:
171171
# For other types, resolve and count
172172
try:
173-
ids = self.env["spp.aggregation.scope.resolver"].resolve(scope)
173+
ids = self.env["spp.analytics.scope.resolver"].resolve(scope)
174174
scope.registrant_count = len(ids)
175175
except (ValidationError, UserError) as e:
176176
_logger.debug("Could not compute registrant count for scope %s: %s", scope.id, e)
@@ -253,7 +253,7 @@ def resolve_registrant_ids(self):
253253
:rtype: list[int]
254254
"""
255255
self.ensure_one()
256-
return self.env["spp.aggregation.scope.resolver"].resolve(self)
256+
return self.env["spp.analytics.scope.resolver"].resolve(self)
257257

258258
def action_preview_registrants(self):
259259
"""Action to preview registrants in this scope."""
@@ -276,7 +276,7 @@ def action_refresh_cache(self):
276276
updates the last_cache_refresh timestamp.
277277
"""
278278
self.ensure_one()
279-
cache_service = self.env["spp.aggregation.cache"]
279+
cache_service = self.env["spp.analytics.cache"]
280280
count = cache_service.invalidate_scope(self)
281281
if count:
282282
scope_name = self.name

spp_aggregation/models/statistic_registry.py renamed to spp_analytics/models/indicator_registry.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
_logger = logging.getLogger(__name__)
77

88

9-
class StatisticRegistry(models.AbstractModel):
9+
class IndicatorRegistry(models.AbstractModel):
1010
"""Registry that maps statistic names to computation strategies.
1111
1212
Replaces the fallback chain in compute_single_statistic with
1313
a clean lookup-based approach. Each statistic type registers
1414
how it should be computed.
1515
"""
1616

17-
_name = "spp.aggregation.statistic.registry"
17+
_name = "spp.analytics.indicator.registry"
1818
_description = "Statistic Computation Registry"
1919

2020
@api.model
@@ -23,7 +23,7 @@ def compute(self, stat_name, registrant_ids, context=None):
2323
2424
Lookup order:
2525
1. Built-in statistics (count, gini)
26-
2. spp.statistic records (via CEL variable)
26+
2. spp.indicator records (via CEL variable)
2727
3. spp.cel.variable records (direct)
2828
2929
:param stat_name: Statistic name
@@ -36,7 +36,7 @@ def compute(self, stat_name, registrant_ids, context=None):
3636
if builtin_method is not None:
3737
return builtin_method(registrant_ids)
3838

39-
# Try spp.statistic (if module installed)
39+
# Try spp.indicator (if module installed)
4040
value = self._try_statistic_model(stat_name, registrant_ids)
4141
if value is not None:
4242
return value
@@ -49,18 +49,18 @@ def compute(self, stat_name, registrant_ids, context=None):
4949
# Provide diagnostic information if debug logging is enabled
5050
if _logger.isEnabledFor(logging.DEBUG):
5151
# Check if models exist
52-
has_stat_model = self.env.get("spp.statistic") is not None
52+
has_stat_model = self.env.get("spp.indicator") is not None
5353
has_var_model = self.env.get("spp.cel.variable") is not None
5454

5555
stat_count = 0
5656
var_count = 0
5757
if has_stat_model:
58-
stat_count = self.env["spp.statistic"].sudo().search_count([]) # nosemgrep: odoo-sudo-without-context
58+
stat_count = self.env["spp.indicator"].sudo().search_count([]) # nosemgrep: odoo-sudo-without-context
5959
if has_var_model:
6060
var_count = self.env["spp.cel.variable"].sudo().search_count([]) # nosemgrep: odoo-sudo-without-context
6161

6262
_logger.debug(
63-
"Statistic lookup failed for '%s'. Available: %d spp.statistic, %d spp.cel.variable",
63+
"Statistic lookup failed for '%s'. Available: %d spp.indicator, %d spp.cel.variable",
6464
stat_name,
6565
stat_count,
6666
var_count,
@@ -82,8 +82,8 @@ def list_available(self):
8282
for name, info in self._BUILTINS.items():
8383
available.append({"name": name, "label": info["label"], "source": "builtin"})
8484

85-
# From spp.statistic
86-
stat_model = self.env.get("spp.statistic")
85+
# From spp.indicator
86+
stat_model = self.env.get("spp.indicator")
8787
if stat_model:
8888
for stat in stat_model.sudo().search([("active", "=", True)]): # nosemgrep: odoo-sudo-without-context
8989
available.append({"name": stat.name, "label": stat.label, "source": "statistic"})
@@ -145,13 +145,13 @@ def _compute_gini(self, registrant_ids):
145145

146146
@api.model
147147
def _try_statistic_model(self, stat_name, registrant_ids):
148-
"""Try computing via spp.statistic record.
148+
"""Try computing via spp.indicator record.
149149
150150
:param stat_name: Statistic name
151151
:param registrant_ids: List of partner IDs
152152
:returns: Computed value or None
153153
"""
154-
stat_model = self.env.get("spp.statistic")
154+
stat_model = self.env.get("spp.indicator")
155155
if stat_model is None:
156156
return None
157157
stat = stat_model.sudo().search([("name", "=", stat_name)], limit=1) # nosemgrep: odoo-sudo-without-context

0 commit comments

Comments
 (0)