Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dd1e955
[ADD] spp_area_base: Initial commit.
gonzalesedwin1123 Feb 12, 2025
ea01aa9
[FIX] spp_area_base: Fix access rights issues.
gonzalesedwin1123 Feb 13, 2025
3d1bef9
[FIX] spp_area_base: Modify the spp_area module to depend on the spp_…
gonzalesedwin1123 Feb 13, 2025
2ffb4cf
[FIX] spp_area: Fix access rights.
gonzalesedwin1123 Feb 13, 2025
84e49ec
[FIX] spp_area_gis: Fix references to spp_area_base views.
gonzalesedwin1123 Feb 13, 2025
15da9b5
[FIX] spp_area_base: Modify the DESCRIPTION.md.
gonzalesedwin1123 Feb 13, 2025
d473e5a
[FIX] spp_change_request: Update the reference to the spp.area model …
gonzalesedwin1123 Feb 13, 2025
ba594a8
[FIX] spp_user_roles: Update the reference to the spp.area model in t…
gonzalesedwin1123 Feb 13, 2025
0869600
[FIX] spp_programs: Update the reference to the spp.area model in the…
gonzalesedwin1123 Feb 13, 2025
c1f9442
[FIX] spp_programs: Update the reference to the spp.area model in eli…
gonzalesedwin1123 Feb 13, 2025
fafd9d3
[FIX] spp_programs: Update the reference to the spp.area model in wiz…
gonzalesedwin1123 Feb 13, 2025
a7acc96
[FIX] spp_eligibility_tags: Update the reference to the spp.area mode…
gonzalesedwin1123 Feb 13, 2025
d3b0420
[FIX] spp_eligibility_tags: Update the reference to the spp.area mode…
gonzalesedwin1123 Feb 13, 2025
5ae1697
[FIX] spp_eligibility_tags: Update the reference to the spp.area mode…
gonzalesedwin1123 Feb 13, 2025
75b2f07
[FIX] spp_area_base: Fix issues with the tests
gonzalesedwin1123 Feb 13, 2025
b06f35e
[FIX] spp_area_base: Fix issues with the tests
gonzalesedwin1123 Feb 13, 2025
642ec0b
[FIX] spp_area_base: Fix issues with the tests
gonzalesedwin1123 Feb 13, 2025
c3090e7
[FIX] spp_area_base: Fix SonarQube reported errors.
gonzalesedwin1123 Feb 13, 2025
5b7a372
[FIX] spp_area_base: Fix SonarQube reported errors.
gonzalesedwin1123 Feb 13, 2025
0b0d14f
[FIX] spp_area_base: Fix SonarQube reported errors.
gonzalesedwin1123 Feb 13, 2025
c654ffb
[FIX] spp_area_base: Fix SonarQube reported errors.
gonzalesedwin1123 Feb 13, 2025
ea209f1
[FIX] spp_area_base: Fix SonarQube cloud duplicate codes issues.
gonzalesedwin1123 Feb 13, 2025
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
14 changes: 3 additions & 11 deletions spp_area/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "OpenSPP Area Management",
"summary": "This module enables management of geographical areas, linking them to registrants for targeted interventions and analysis in social protection programs.",
"summary": "This module extends the OpenSPP Area (Base) module to include additional features for managing and organizing geographical areas within the system.",
"category": "OpenSPP",
"version": "17.0.1.3.0",
"sequence": 1,
Expand All @@ -14,25 +14,17 @@
"maintainers": ["jeremi", "gonzalesedwin1123", "reichie020212"],
"depends": [
"base",
"spp_area_base",
"g2p_registry_base",
"g2p_registry_individual",
"g2p_registry_group",
"queue_job",
],
"external_dependencies": {
"python": [
"xlrd",
]
},
"external_dependencies": {},
"data": [
"data/area_kind_data.xml",
"data/queue_job_channel.xml",
"security/ir.model.access.csv",
"views/individual_views.xml",
"views/group_views.xml",
"views/area.xml",
"views/area_kind.xml",
"views/area_import_views.xml",
],
"assets": {},
"demo": [],
Expand Down
2 changes: 0 additions & 2 deletions spp_area/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Part of OpenSPP. See LICENSE file for full copyright and licensing details.


from . import area
from . import registrant
from . import area_import
2 changes: 1 addition & 1 deletion spp_area/models/registrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def _get_area_domain(self):
"""
This set up the domain of the area base on its kind
"""
area_id = self.env.ref("spp_area.admin_area_kind").id
area_id = self.env.ref("spp_area_base.admin_area_kind").id
return [("kind", "=", area_id)]

# Custom Fields
Expand Down
2 changes: 1 addition & 1 deletion spp_area/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenSPP Area

This document describes the **OpenSPP Area** module, which extends the OpenSPP framework by providing features to manage and organize geographical areas within the system. It integrates with the core registry modules to allow associating registrants and other data with specific locations.
This document describes the **OpenSPP Area** module, which extends the OpenSPP Area Base module.

## Purpose

Expand Down
10 changes: 5 additions & 5 deletions spp_area/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
spp_area_admin,Area Admin Access,spp_area.model_spp_area,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_area_import_admin,Area Import Admin Access,spp_area.model_spp_area_import,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_area_import_raw_admin,Area Import Raw Admin Access,spp_area.model_spp_area_import_raw,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_area_kind_admin,Area Kind Admin Access,spp_area.model_spp_area_kind,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_area_admin,Area Admin Access,spp_area_base.model_spp_area,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_area_import_admin,Area Import Admin Access,spp_area_base.model_spp_area_import,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_area_import_raw_admin,Area Import Raw Admin Access,spp_area_base.model_spp_area_import_raw,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_area_kind_admin,Area Kind Admin Access,spp_area_base.model_spp_area_kind,g2p_registry_base.group_g2p_admin,1,1,1,1

spp_area_registrar,Area Registrar Access,spp_area.model_spp_area,g2p_registry_base.group_g2p_registrar,1,1,1,0
spp_area_registrar,Area Registrar Access,spp_area_base.model_spp_area,g2p_registry_base.group_g2p_registrar,1,1,1,0
165 changes: 165 additions & 0 deletions spp_area_base/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
=======================
OpenSPP Area Management
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e6e98dfbc0dfec92d49f42a8d99cd1c4e2fd8edd889a3165a76df9d78c301196
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OpenSPP%2Fopenspp--modules-lightgray.png?logo=github
:target: https://github.com/OpenSPP/openspp-modules/tree/17.0/spp_area
:alt: OpenSPP/openspp-modules

|badge1| |badge2| |badge3|

OpenSPP Area
============

This document describes the **OpenSPP Area** module, which extends the
OpenSPP framework by providing features to manage and organize
geographical areas within the system. It integrates with the core
registry modules to allow associating registrants and other data with
specific locations.

Purpose
-------

The **OpenSPP Area** module is designed to:

- **Define and Structure Geographical Areas**: Establish a hierarchical
structure for representing administrative regions, from the highest
level (e.g., country) down to the most granular level (e.g.,
village).
- **Manage Area Information**: Store key details about each area,
including its name, code, alternate names, geographical size, and
parent-child relationships within the hierarchy.
- **Associate Registrants with Areas**: Enable the linking of
individual and group registrants to specific areas, facilitating
location-based targeting, analysis, and program implementation.

Dependencies and Integration
----------------------------

1. **G2P Registry: Base
(**\ `g2p_registry_base <g2p_registry_base>`__\ **)**: The Area
module utilizes the **Districts (g2p.district)** feature from the
**G2P Registry: Base** module as a foundation. It extends this
concept to create a more comprehensive and flexible system for
managing area data.

2. **G2P Registry: Individual
(**\ `g2p_registry_individual <g2p_registry_individual>`__\ **)**:
Integrates with the Individual module by adding a dedicated "Area"
field to the individual registrant form. This field allows users to
assign a specific area to each individual, linking registrant data to
geographical locations.

3. **G2P Registry: Group
(**\ `g2p_registry_group <g2p_registry_group>`__\ **)**: Similar to
the Individual module integration, this module incorporates an "Area"
field into the group registrant form, enabling the association of
groups with specific areas.

4. **Queue Job (**\ `queue_job <queue_job>`__\ **)**: Leverages the
**Queue Job** module for background processing of large data imports,
improving performance and user experience. This is particularly
beneficial when importing extensive area hierarchies from external
sources.

Additional Functionality
------------------------

- **Hierarchical Area Structure (**\ `spp.area <spp.area>`__\ **)**:

- Introduces a dedicated model for managing areas, allowing for the
creation of multi-level administrative boundaries with
parent-child relationships.
- Computes and displays the complete area path (e.g., "Country >
Province > District > Village") to provide clear context within
the hierarchy.
- Enforces unique codes for each area to ensure proper
identification and prevent duplicates.

- **Area Types (**\ `spp.area.kind <spp.area.kind>`__\ **)**:

- Includes a model for defining and managing different types of
areas (e.g., administrative regions, ecological zones, project
implementation areas).
- Allows for the creation of a hierarchy of area types, providing
further categorization and flexibility.

- **Area Import Functionality**:

- Provides tools for importing area data in bulk from Excel files,
streamlining the process of populating the area hierarchy.
- Implements validation rules during the import process to ensure
data integrity, such as checking for required fields, data types,
and hierarchical consistency.
- Utilizes the Queue Job module to perform data validation and
import operations in the background, preventing performance issues
and providing a smoother user experience.
- Ability to localize the name of the imported area.

Conclusion
----------

The **OpenSPP Area** module enhances the OpenSPP platform by providing a
robust and flexible system for managing geographical areas and linking
them to registrant data. Its integration with the core registry modules
ensures that location information is seamlessly incorporated into the
overall system, supporting location-based targeting, analysis, and
program management for social protection programs and farmer registries.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OpenSPP/openspp-modules/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OpenSPP/openspp-modules/issues/new?body=module:%20spp_area%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* OpenSPP.org

Maintainers
-----------

.. |maintainer-jeremi| image:: https://github.com/jeremi.png?size=40px
:target: https://github.com/jeremi
:alt: jeremi
.. |maintainer-gonzalesedwin1123| image:: https://github.com/gonzalesedwin1123.png?size=40px
:target: https://github.com/gonzalesedwin1123
:alt: gonzalesedwin1123
.. |maintainer-reichie020212| image:: https://github.com/reichie020212.png?size=40px
:target: https://github.com/reichie020212
:alt: reichie020212

Current maintainers:

|maintainer-jeremi| |maintainer-gonzalesedwin1123| |maintainer-reichie020212|

This module is part of the `OpenSPP/openspp-modules <https://github.com/OpenSPP/openspp-modules/tree/17.0/spp_area>`_ project on GitHub.

You are welcome to contribute.
4 changes: 4 additions & 0 deletions spp_area_base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Part of OpenSPP. See LICENSE file for full copyright and licensing details.


from . import models
38 changes: 38 additions & 0 deletions spp_area_base/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Part of OpenSPP. See LICENSE file for full copyright and licensing details.


{
"name": "OpenSPP Area Management (Base)",
"summary": "This module enables management of geographical areas, linking them to registrants for targeted interventions and analysis in social protection programs.",
"category": "OpenSPP",
"version": "17.0.1.3.0",
"sequence": 1,
"author": "OpenSPP.org",
"website": "https://github.com/OpenSPP/openspp-modules",
"license": "LGPL-3",
"development_status": "Production/Stable",
"maintainers": ["jeremi", "gonzalesedwin1123", "reichie020212"],
"depends": [
"base",
"queue_job",
],
"external_dependencies": {
"python": [
"xlrd",
]
},
"data": [
"data/area_kind_data.xml",
"data/queue_job_channel.xml",
"security/ir.model.access.csv",
"views/area.xml",
"views/area_kind.xml",
"views/area_import_views.xml",
],
"assets": {},
"demo": [],
"images": [],
"application": True,
"installable": True,
"auto_install": False,
}
File renamed without changes.
Loading
Loading