Skip to content

Commit ad3796f

Browse files
Merge pull request #23 from OpenSPP/fix/area-ui-labels-and-help
fix(spp_area, spp_gis_report): add labels and help to area form fields
2 parents c2d2683 + e8f428c commit ad3796f

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

spp_area/views/area_base.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<field name="level" invisible="1" />
6262

6363
<!-- Main Information -->
64-
<group>
64+
<group name="main_info">
6565
<group string="Basic Information">
6666
<field name="code" placeholder="Area Code..." />
6767
<field
@@ -72,14 +72,21 @@
7272
<field name="complete_name" readonly="1" />
7373
</group>
7474
<group string="Classification">
75-
<field name="area_level" />
75+
<field
76+
name="area_level"
77+
string="Admin Level"
78+
help="Hierarchical level of this area, automatically computed from its position in the area tree (0 = top-level)."
79+
/>
7680
<field
7781
name="area_type_id"
82+
string="Area Type"
83+
help="Classification type for this area (e.g., Province, Municipality, Barangay)."
7884
options="{'no_open': True, 'no_create': True}"
7985
/>
8086
<field
8187
name="area_sqkm"
82-
string="Area (sq/km)"
88+
string="Area (km²)"
89+
help="Geographic size of this area in square kilometers."
8390
widget="float"
8491
/>
8592
</group>

spp_gis_report/models/area_ext.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ class Area(models.Model):
1717
# ===== Reference Data for Normalization =====
1818
population = fields.Integer(
1919
"Population",
20-
help="Total population from census or estimate",
20+
help="Total population from census or official estimate. Used for per-capita normalization in GIS reports.",
2121
)
2222
population_date = fields.Date(
2323
"Population Data Date",
24-
help="Date of population data",
24+
help="Date when the population data was collected or published.",
2525
)
2626
population_source = fields.Char(
2727
"Population Data Source",
28-
help="Source of population data (e.g., 'National Census 2020')",
28+
help="Source of the population data, e.g., 'National Census 2020' or 'UNFPA Estimate'.",
2929
)
3030

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

3636
# ===== Registry Counts (Updated via scheduled refresh) =====

spp_gis_report/views/area_views.xml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,21 @@ Part of OpenSPP. See LICENSE file for full copyright and licensing details.
1313
<field name="inherit_id" ref="spp_area.view_spparea_form" />
1414
<field name="priority">20</field>
1515
<field name="arch" type="xml">
16-
<!-- Add Reference Data section after area_sqkm field -->
17-
<xpath expr="//field[@name='area_sqkm']" position="after">
16+
<!-- Add Reference Data section after the main info group -->
17+
<xpath expr="//group[@name='main_info']" position="after">
1818
<separator string="Reference Data for GIS Reports" />
19+
<div class="text-muted small mb-2">
20+
These fields are populated from external sources such as national census data or official estimates.
21+
They are used for normalization in GIS reports (e.g., per-capita or per-household calculations).
22+
</div>
1923
<group name="gis_reference_data" col="2">
2024
<group name="population_group">
21-
<field name="population" />
22-
<field name="population_date" />
23-
<field name="population_source" />
25+
<field name="population" readonly="1" />
26+
<field name="population_date" readonly="1" />
27+
<field name="population_source" readonly="1" />
2428
</group>
2529
<group name="household_group">
26-
<field name="household_count" />
30+
<field name="household_count" readonly="1" />
2731
</group>
2832
</group>
2933
</xpath>

0 commit comments

Comments
 (0)