Skip to content

Commit 69e0e5a

Browse files
Merge pull request #68 from OpenSPP/push-modules-set-to-stable
feat(grm,case): add case management modules and sync GRM with stable
2 parents 68c7c17 + 3fce171 commit 69e0e5a

File tree

302 files changed

+40634
-474
lines changed

Some content is hidden

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

302 files changed

+40634
-474
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,4 +304,4 @@ repos:
304304
# Only scan OpenSPP spp_* modules (not scripts, endpoint handlers, etc.)
305305
files: ^spp_
306306
# Exclude test files, migrations, and demo-only modules
307-
exclude: ^(tests/|scripts/tests/|.*/tests/.*|.*/migrations/.*|spp_4ps_demo/)
307+
exclude: ^(tests/|scripts/tests/|.*/tests/.*|.*/migrations/.*|spp_4ps_demo/|spp_case_demo/|spp_grm_demo/)

codecov.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Codecov configuration for OpenSPP
2+
# https://docs.codecov.io/docs/codecov-yaml
3+
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
# Only check coverage on files changed in this PR, not the entire project.
9+
# CI only tests changed modules, so project-wide coverage would always drop
10+
# on PRs that don't re-test every module.
11+
only_pulls: true
12+
patch:
13+
default:
14+
target: 70%
15+
16+
# Each module uploads with its own flag (flags: ${{ matrix.module }} in CI).
17+
# Carry forward coverage from previous commits so modules not tested in this
18+
# PR still contribute to overall project coverage.
19+
flag_management:
20+
default_rules:
21+
carryforward: true
22+
23+
comment:
24+
layout: "reach,diff,flags,files"
25+
behavior: default
26+
require_changes: false
27+
28+
ignore:
29+
- "**/tests/**"
30+
- "**/migrations/**"
31+
- "scripts/**"

spp_case_base/README.rst

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
============================
2+
OpenSPP Case Management Base
3+
============================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:e58edc2517398a8339ded8ff8bf1eb6b07df10f996637a160c55d36dbf41b8a6
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Production/Stable
16+
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |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_case_base
21+
:alt: OpenSPP/OpenSPP2
22+
23+
|badge1| |badge2| |badge3|
24+
25+
Case management system for social protection programs. Tracks cases from
26+
intake through assessment, intervention planning, and closure with
27+
workflow stages, risk assessments, and team assignment. Automated review
28+
scheduling via cron job ensures timely case monitoring.
29+
30+
Key Capabilities
31+
~~~~~~~~~~~~~~~~
32+
33+
- Track cases for individuals, households, or groups with configurable
34+
types and workflow stages
35+
- Conduct assessments with risk scoring (0-100) and automatic risk level
36+
classification (low/medium/high/critical)
37+
- Create versioned intervention plans with approval workflows and
38+
progress tracking
39+
- Document case activities: visits, notes, referrals to external
40+
services
41+
- Assign cases to workers and teams with supervisor oversight
42+
- Schedule automated review reminders for cases approaching or past
43+
review dates
44+
45+
Key Models
46+
~~~~~~~~~~
47+
48+
+--------------------------------+-------------------------------------+
49+
| Model | Description |
50+
+================================+=====================================+
51+
| ``spp.case`` | Core case record with client and |
52+
| | assignment |
53+
+--------------------------------+-------------------------------------+
54+
| ``spp.case.type`` | Case type with default intensity |
55+
| | and caseload |
56+
+--------------------------------+-------------------------------------+
57+
| ``spp.case.stage`` | Workflow stage with phase and |
58+
| | requirements |
59+
+--------------------------------+-------------------------------------+
60+
| ``spp.case.assessment`` | Assessment with risk score and |
61+
| | findings |
62+
+--------------------------------+-------------------------------------+
63+
| ``spp.case.intervention.plan`` | Versioned plan with approval |
64+
| | workflow |
65+
+--------------------------------+-------------------------------------+
66+
| ``spp.case.intervention`` | Individual intervention with status |
67+
| | tracking |
68+
+--------------------------------+-------------------------------------+
69+
| ``spp.case.visit`` | Client visit with type and notes |
70+
+--------------------------------+-------------------------------------+
71+
| ``spp.case.note`` | Case note with confidentiality flag |
72+
+--------------------------------+-------------------------------------+
73+
| ``spp.case.referral`` | External service referral with |
74+
| | status |
75+
+--------------------------------+-------------------------------------+
76+
| ``spp.case.team`` | Team with supervisor and members |
77+
+--------------------------------+-------------------------------------+
78+
| ``spp.case.risk.factor`` | Risk factor with severity weight |
79+
+--------------------------------+-------------------------------------+
80+
| ``spp.case.vulnerability`` | Vulnerability for assessment |
81+
+--------------------------------+-------------------------------------+
82+
| ``spp.case.closure.reason`` | Closure reason with outcome type |
83+
+--------------------------------+-------------------------------------+
84+
85+
Configuration
86+
~~~~~~~~~~~~~
87+
88+
After installing:
89+
90+
1. Navigate to **Case Management > Configuration > Case Setup > Case
91+
Types** and create case types
92+
2. Navigate to **Case Management > Configuration > Case Setup > Case
93+
Stages** and define workflow stages
94+
3. Navigate to **Case Management > Configuration > Case Setup > Case
95+
Teams** and create teams
96+
4. Navigate to **Case Management > Configuration > Assessment > Risk
97+
Factors** and define risk factors
98+
5. Navigate to **Case Management > Configuration > Assessment >
99+
Vulnerabilities** and define vulnerabilities
100+
6. Navigate to **Case Management > Configuration > Closure > Closure
101+
Reasons** and set up closure reasons
102+
7. Verify the cron job **Case Management: Check Review Schedules** is
103+
active under **Settings > Technical > Scheduled Actions**
104+
105+
UI Location
106+
~~~~~~~~~~~
107+
108+
- **Cases**: Case Management > Cases > All Cases / My Cases / Unassigned
109+
Cases
110+
- **Activities**: Case Management > Activities > Visits / Notes /
111+
Referrals / Assessments
112+
- **Planning**: Case Management > Planning > Intervention Plans /
113+
Interventions
114+
- **Configuration**: Case Management > Configuration (Manager role
115+
required)
116+
- **Form tabs**: Details, Participants, Programs, History
117+
118+
Security
119+
~~~~~~~~
120+
121+
========================= ==============================================
122+
Group Access
123+
========================= ==============================================
124+
``group_case_viewer`` Read-only access to all case records
125+
``group_case_worker`` Full CRUD on cases and activities
126+
``group_case_supervisor`` Full CRUD on cases and activities, read config
127+
``group_case_manager`` Full CRUD including configuration
128+
========================= ==============================================
129+
130+
Extension Points
131+
~~~~~~~~~~~~~~~~
132+
133+
- Override ``_check_stage_requirements()`` on ``spp.case`` for custom
134+
stage validation
135+
- Override ``_compute_risk_level()`` on ``spp.case.assessment`` to
136+
customize risk calculation thresholds
137+
- Extend ``spp.case.intervention.plan`` with domain-specific fields
138+
- Hook ``_cron_check_reviews()`` to add custom review logic or
139+
notification templates
140+
141+
Dependencies
142+
~~~~~~~~~~~~
143+
144+
``base``, ``mail``, ``portal``, ``spp_security``
145+
146+
**Table of contents**
147+
148+
.. contents::
149+
:local:
150+
151+
Bug Tracker
152+
===========
153+
154+
Bugs are tracked on `GitHub Issues <https://github.com/OpenSPP/OpenSPP2/issues>`_.
155+
In case of trouble, please check there if your issue has already been reported.
156+
If you spotted it first, help us to smash it by providing a detailed and welcomed
157+
`feedback <https://github.com/OpenSPP/OpenSPP2/issues/new?body=module:%20spp_case_base%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
158+
159+
Do not contact contributors directly about support or help with technical issues.
160+
161+
Credits
162+
=======
163+
164+
Authors
165+
-------
166+
167+
* OpenSPP.org
168+
169+
Maintainers
170+
-----------
171+
172+
.. |maintainer-jeremi| image:: https://github.com/jeremi.png?size=40px
173+
:target: https://github.com/jeremi
174+
:alt: jeremi
175+
.. |maintainer-gonzalesedwin1123| image:: https://github.com/gonzalesedwin1123.png?size=40px
176+
:target: https://github.com/gonzalesedwin1123
177+
:alt: gonzalesedwin1123
178+
.. |maintainer-emjay0921| image:: https://github.com/emjay0921.png?size=40px
179+
:target: https://github.com/emjay0921
180+
:alt: emjay0921
181+
182+
Current maintainers:
183+
184+
|maintainer-jeremi| |maintainer-gonzalesedwin1123| |maintainer-emjay0921|
185+
186+
This module is part of the `OpenSPP/OpenSPP2 <https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_case_base>`_ project on GitHub.
187+
188+
You are welcome to contribute.

spp_case_base/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

spp_case_base/__manifest__.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# pylint: disable=pointless-statement
2+
{
3+
"name": "OpenSPP Case Management Base",
4+
"version": "19.0.1.0.0",
5+
"category": "OpenSPP/Monitoring",
6+
"summary": "Core case management functionality for OpenSPP",
7+
"author": "OpenSPP.org",
8+
"website": "https://github.com/OpenSPP/OpenSPP2",
9+
"license": "LGPL-3",
10+
"development_status": "Production/Stable",
11+
"maintainers": ["jeremi", "gonzalesedwin1123", "emjay0921"],
12+
"depends": [
13+
"base",
14+
"mail",
15+
"portal",
16+
"spp_security",
17+
],
18+
"data": [
19+
# Security
20+
"security/privileges.xml",
21+
"security/groups.xml",
22+
"security/case_security.xml",
23+
"security/ir.model.access.csv",
24+
"security/rules.xml",
25+
# Data
26+
"data/ir_cron.xml",
27+
# Views - load actions first, then main case view that references them
28+
"views/case_stage_views.xml",
29+
"views/case_type_views.xml",
30+
"views/case_assessment_views.xml",
31+
"views/case_intervention_views.xml",
32+
"views/case_activity_views.xml",
33+
"views/case_config_views.xml",
34+
"views/case_views.xml",
35+
# Menus
36+
"views/case_menus.xml",
37+
],
38+
"demo": [],
39+
"installable": True,
40+
"application": True,
41+
"auto_install": False,
42+
}

spp_case_base/data/ir_cron.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="cron_check_case_reviews" model="ir.cron">
4+
<field name="name">Case Management: Check Review Schedules</field>
5+
<field name="model_id" ref="model_spp_case" />
6+
<field name="state">code</field>
7+
<field name="code">model._cron_check_reviews()</field>
8+
<field name="interval_number">1</field>
9+
<field name="interval_type">days</field>
10+
<field name="active" eval="True" />
11+
</record>
12+
</odoo>

spp_case_base/models/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from . import case_config
2+
from . import case_stage
3+
from . import case_type
4+
from . import case
5+
from . import case_assessment
6+
from . import case_intervention_plan
7+
from . import case_intervention
8+
from . import case_visit
9+
from . import case_note
10+
from . import case_referral

0 commit comments

Comments
 (0)