Skip to content

Commit f3177c2

Browse files
authored
Merge branch '19.0' into fix/api-v2-skip-records-without-identifiers
2 parents d83e763 + 5a7544e commit f3177c2

45 files changed

Lines changed: 4746 additions & 1826 deletions

Some content is hidden

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

spp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ import shutil
2222
import subprocess
2323
import sys
2424
import time
25-
import tomllib
25+
26+
try:
27+
import tomllib
28+
except ModuleNotFoundError:
29+
try:
30+
import tomli as tomllib
31+
except ModuleNotFoundError:
32+
tomllib = None
2633
from pathlib import Path
2734

2835
try:
@@ -99,13 +106,15 @@ DEFAULT_CONFIG = {
99106
def load_config() -> dict:
100107
"""Load config from ~/.spp.toml, returning defaults if not found."""
101108
config = DEFAULT_CONFIG.copy()
102-
if CONFIG_PATH.exists():
109+
if CONFIG_PATH.exists() and tomllib is not None:
103110
try:
104111
with open(CONFIG_PATH, "rb") as f:
105112
user_config = tomllib.load(f)
106113
config.update(user_config)
107114
except (tomllib.TOMLDecodeError, OSError) as e:
108115
warn(f"Could not load config from {CONFIG_PATH}: {e}")
116+
elif CONFIG_PATH.exists() and tomllib is None:
117+
warn("tomllib not available (Python < 3.11). Install 'tomli' or upgrade Python to load ~/.spp.toml config.")
109118
return config
110119

111120

@@ -131,7 +140,7 @@ DEMO_PROFILES = {
131140
}
132141

133142

134-
def run(cmd: str | list, check: bool = True, capture: bool = False, **kwargs) -> subprocess.CompletedProcess:
143+
def run(cmd, check: bool = True, capture: bool = False, **kwargs) -> subprocess.CompletedProcess:
135144
"""Run a command with nice defaults."""
136145
if isinstance(cmd, str):
137146
kwargs.setdefault("shell", True)
@@ -909,7 +918,7 @@ def cmd_sql(args):
909918
run(docker_compose("exec", "db", "psql", "-U", "odoo", "-d", db_name))
910919

911920

912-
def _show_url(open_browser: bool = False) -> str | None:
921+
def _show_url(open_browser: bool = False):
913922
"""Get the running Odoo server URL."""
914923
service, profile = _find_running_odoo()
915924
if not service:

spp_api_v2/tests/test_search_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def test_search_by_name(self):
5757
self.assertEqual(total, 2)
5858
self.assertEqual(len(records), 2)
5959
names = [r.name for r in records]
60-
self.assertIn("Alice Johnson", names)
61-
self.assertIn("Alice Brown", names)
60+
self.assertIn("JOHNSON, ALICE", names)
61+
self.assertIn("BROWN, ALICE", names)
6262

6363
def test_parse_identifier_param(self):
6464
"""identifier=system|value creates proper domain"""
@@ -224,7 +224,7 @@ def test_search_combined_params(self):
224224
# Should find Alice Johnson and Alice Brown (both female)
225225
self.assertEqual(total, 2)
226226
for record in records:
227-
self.assertIn("Alice", record.name)
227+
self.assertIn("ALICE", record.name)
228228
self.assertEqual(record.gender_id, self.gender_female)
229229

230230

spp_case_demo/README.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ OpenSPP Case Management Demo Data
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:39196739031b49c0d69e329806b940da071ca49472f130cd28ffd45eda6459e7
10+
!! source digest: sha256:force_regen
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
@@ -24,16 +24,20 @@ OpenSPP Case Management Demo Data
2424

2525
Demo data generator for Case Management system. Creates realistic cases
2626
with intervention plans, home visits, progress notes, and service
27-
referrals. Includes 9 fixed demo stories for training and sales demos,
28-
plus configurable random case generation for volume testing.
27+
referrals. Includes 9 fixed demo stories plus 3 background cases for
28+
training and sales demos, and configurable volume case generation using
29+
Faker for locale-aware random data (non-deterministic — each run
30+
produces different results).
2931

3032
Key Capabilities
3133
~~~~~~~~~~~~~~~~
3234

3335
- Generate 9 fixed demo stories with predictable personas and case
34-
progressions for consistent training scenarios
35-
- Create random volume cases with configurable distribution percentages
36-
for plans, visits, notes, and closures
36+
progressions for consistent training scenarios, plus 3 background
37+
cases (Fernandez Intake Pending, Johnson Assessment, Kim Case Closed)
38+
for variety
39+
- Create random volume cases using Faker (non-seeded) with configurable
40+
distribution percentages for plans, visits, notes, and closures
3741
- Link generated cases to existing registrants or create standalone
3842
cases
3943
- Backdate case records and related activities to simulate realistic

spp_case_demo/readme/DESCRIPTION.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Demo data generator for Case Management system. Creates realistic cases with intervention plans, home visits, progress notes, and service referrals. Includes 9 fixed demo stories for training and sales demos, plus configurable random case generation for volume testing.
1+
Demo data generator for Case Management system. Creates realistic cases with intervention plans, home visits, progress notes, and service referrals. Includes 9 fixed demo stories plus 3 background cases for training and sales demos, and configurable volume case generation using Faker for locale-aware random data (non-deterministic — each run produces different results).
22

33
### Key Capabilities
44

5-
- Generate 9 fixed demo stories with predictable personas and case progressions for consistent training scenarios
6-
- Create random volume cases with configurable distribution percentages for plans, visits, notes, and closures
5+
- Generate 9 fixed demo stories with predictable personas and case progressions for consistent training scenarios, plus 3 background cases (Fernandez Intake Pending, Johnson Assessment, Kim Case Closed) for variety
6+
- Create random volume cases using Faker (non-seeded) with configurable distribution percentages for plans, visits, notes, and closures
77
- Link generated cases to existing registrants or create standalone cases
88
- Backdate case records and related activities to simulate realistic timelines over configurable day ranges
99
- Create intervention plans with multiple interventions across case lifecycle stages

spp_case_demo/static/description/index.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,20 +367,24 @@ <h1 class="title">OpenSPP Case Management Demo Data</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:39196739031b49c0d69e329806b940da071ca49472f130cd28ffd45eda6459e7
370+
!! source digest: sha256:force_regen
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372372
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_case_demo"><img alt="OpenSPP/OpenSPP2" src="https://img.shields.io/badge/github-OpenSPP%2FOpenSPP2-lightgray.png?logo=github" /></a></p>
373373
<p>Demo data generator for Case Management system. Creates realistic cases
374374
with intervention plans, home visits, progress notes, and service
375-
referrals. Includes 9 fixed demo stories for training and sales demos,
376-
plus configurable random case generation for volume testing.</p>
375+
referrals. Includes 9 fixed demo stories plus 3 background cases for
376+
training and sales demos, and configurable volume case generation using
377+
Faker for locale-aware random data (non-deterministic — each run
378+
produces different results).</p>
377379
<div class="section" id="key-capabilities">
378380
<h1>Key Capabilities</h1>
379381
<ul class="simple">
380382
<li>Generate 9 fixed demo stories with predictable personas and case
381-
progressions for consistent training scenarios</li>
382-
<li>Create random volume cases with configurable distribution percentages
383-
for plans, visits, notes, and closures</li>
383+
progressions for consistent training scenarios, plus 3 background
384+
cases (Fernandez Intake Pending, Johnson Assessment, Kim Case Closed)
385+
for variety</li>
386+
<li>Create random volume cases using Faker (non-seeded) with configurable
387+
distribution percentages for plans, visits, notes, and closures</li>
384388
<li>Link generated cases to existing registrants or create standalone
385389
cases</li>
386390
<li>Backdate case records and related activities to simulate realistic

0 commit comments

Comments
 (0)