Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 10 additions & 3 deletions spp_area/views/area_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<field name="level" invisible="1" />

<!-- Main Information -->
<group>
<group name="main_info">
<group string="Basic Information">
<field name="code" placeholder="Area Code..." />
<field
Expand All @@ -72,14 +72,21 @@
<field name="complete_name" readonly="1" />
</group>
<group string="Classification">
<field name="area_level" />
<field
name="area_level"
string="Admin Level"
help="Hierarchical level of this area, automatically computed from its position in the area tree (0 = top-level)."
/>
<field
name="area_type_id"
string="Area Type"
help="Classification type for this area (e.g., Province, Municipality, Barangay)."
options="{'no_open': True, 'no_create': True}"
/>
<field
name="area_sqkm"
string="Area (sq/km)"
string="Area (km²)"
help="Geographic size of this area in square kilometers."
widget="float"
/>
</group>
Expand Down
8 changes: 4 additions & 4 deletions spp_gis_report/models/area_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ class Area(models.Model):
# ===== Reference Data for Normalization =====
population = fields.Integer(
"Population",
help="Total population from census or estimate",
help="Total population from census or official estimate. Used for per-capita normalization in GIS reports.",
)
population_date = fields.Date(
"Population Data Date",
help="Date of population data",
help="Date when the population data was collected or published.",
)
population_source = fields.Char(
"Population Data Source",
help="Source of population data (e.g., 'National Census 2020')",
help="Source of the population data, e.g., 'National Census 2020' or 'UNFPA Estimate'.",
)

household_count = fields.Integer(
"Household Count",
help="Number of households in this area",
help="Number of households in this area. Used for per-household normalization in GIS reports.",
)

# ===== Registry Counts (Updated via scheduled refresh) =====
Expand Down
16 changes: 10 additions & 6 deletions spp_gis_report/views/area_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ Part of OpenSPP. See LICENSE file for full copyright and licensing details.
<field name="inherit_id" ref="spp_area.view_spparea_form" />
<field name="priority">20</field>
<field name="arch" type="xml">
<!-- Add Reference Data section after area_sqkm field -->
<xpath expr="//field[@name='area_sqkm']" position="after">
<!-- Add Reference Data section after the main info group -->
<xpath expr="//group[@name='main_info']" position="after">
<separator string="Reference Data for GIS Reports" />
<div class="text-muted small mb-2">
These fields are populated from external sources such as national census data or official estimates.
They are used for normalization in GIS reports (e.g., per-capita or per-household calculations).
</div>
<group name="gis_reference_data" col="2">
<group name="population_group">
<field name="population" />
<field name="population_date" />
<field name="population_source" />
<field name="population" readonly="1" />
<field name="population_date" readonly="1" />
<field name="population_source" readonly="1" />
</group>
<group name="household_group">
<field name="household_count" />
<field name="household_count" readonly="1" />
</group>
</group>
</xpath>
Expand Down
Loading