Skip to content

Commit 4a706fb

Browse files
committed
fix(spp_area, spp_gis_report): add labels and help to classification and GIS reference fields
1 parent 5a04d3a commit 4a706fb

2 files changed

Lines changed: 89 additions & 36 deletions

File tree

spp_area/views/area_base.xml

Lines changed: 73 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@
55
<field name="priority">1</field>
66
<field name="arch" type="xml">
77
<list>
8-
<field name="name" column_invisible="1"/>
9-
<field name="draft_name" string="Name"/>
8+
<field name="name" column_invisible="1" />
9+
<field name="draft_name" string="Name" />
1010
<field name="altnames" />
1111
<field name="code" />
1212
<field name="parent_id" />
1313
<field name="complete_name" string="Complete Name" />
1414
<field name="area_level" />
1515
<field name="area_type_id" string="Area Type" />
16-
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" optional="hide" />
16+
<field
17+
name="tag_ids"
18+
widget="many2many_tags"
19+
options="{'color_field': 'color'}"
20+
optional="hide"
21+
/>
1722
</list>
1823
</field>
1924
</record>
@@ -27,67 +32,89 @@
2732
<sheet>
2833
<!-- Title Section -->
2934
<div class="oe_title">
30-
<label for="parent_id" class="oe_edit_only"/>
35+
<label for="parent_id" class="oe_edit_only" />
3136
<h3 class="text-muted mb-2">
3237
<field
3338
name="parent_id"
3439
placeholder="Select Parent Area..."
35-
options="{'no_open':True,'no_create_edit':True,'no_create':True}"/>
40+
options="{'no_open':True,'no_create_edit':True,'no_create':True}"
41+
/>
3642
</h3>
37-
<label for="name" class="oe_edit_only"/>
43+
<label for="name" class="oe_edit_only" />
3844
<h1>
3945
<field
4046
name="name"
4147
placeholder="Area Name..."
4248
readonly="1"
4349
force_save="1"
44-
class="oe_read_only"/>
50+
class="oe_read_only"
51+
/>
4552
<field
4653
name="draft_name"
4754
placeholder="Enter Area Name..."
48-
class="oe_edit_only"/>
55+
class="oe_edit_only"
56+
/>
4957
</h1>
5058
</div>
5159

5260
<!-- Hidden Fields -->
53-
<field name="level" invisible="1"/>
61+
<field name="level" invisible="1" />
5462

5563
<!-- Main Information -->
5664
<group>
5765
<group string="Basic Information">
58-
<field name="code" placeholder="Area Code..."/>
59-
<field name="altnames"
60-
string="Alternate Names"
61-
placeholder="Alternative names for this area..."/>
62-
<field name="complete_name" readonly="1"/>
66+
<field name="code" placeholder="Area Code..." />
67+
<field
68+
name="altnames"
69+
string="Alternate Names"
70+
placeholder="Alternative names for this area..."
71+
/>
72+
<field name="complete_name" readonly="1" />
6373
</group>
6474
<group string="Classification">
65-
<field name="area_level"/>
66-
<field name="area_type_id"
67-
options="{'no_open': True, 'no_create': True}"/>
68-
<field name="area_sqkm"
69-
string="Area (sq/km)"
70-
widget="float"/>
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+
/>
80+
<field
81+
name="area_type_id"
82+
string="Area Type"
83+
help="Classification type for this area (e.g., Province, Municipality, Barangay)."
84+
options="{'no_open': True, 'no_create': True}"
85+
/>
86+
<field
87+
name="area_sqkm"
88+
string="Area (sq km)"
89+
help="Geographic size of this area in square kilometers."
90+
widget="float"
91+
/>
7192
</group>
7293
</group>
7394

7495
<!-- Tags Section -->
7596
<group string="Tags">
76-
<field name="tag_ids"
77-
widget="many2many_tags"
78-
placeholder="Add tags..."
79-
options="{'color_field': 'color', 'no_create_edit': True}"/>
97+
<field
98+
name="tag_ids"
99+
widget="many2many_tags"
100+
placeholder="Add tags..."
101+
options="{'color_field': 'color', 'no_create_edit': True}"
102+
/>
80103
</group>
81104

82105
<!-- Child Areas -->
83106
<notebook>
84107
<page name="child" string="Child Areas">
85108
<field name="child_ids" nolabel="1">
86109
<list>
87-
<field name="name"/>
88-
<field name="code" optional="show"/>
89-
<field name="area_type_id" string="Type" optional="show"/>
90-
<field name="area_level" optional="hide"/>
110+
<field name="name" />
111+
<field name="code" optional="show" />
112+
<field
113+
name="area_type_id"
114+
string="Type"
115+
optional="show"
116+
/>
117+
<field name="area_level" optional="hide" />
91118
</list>
92119
</field>
93120
</page>
@@ -106,8 +133,16 @@
106133
<field name="name" />
107134
<field name="parent_id" />
108135
<field name="tag_ids" />
109-
<filter name="grp_parent" string="Parent" context="{'group_by': 'parent_id'}" />
110-
<filter name="grp_level" string="Level" context="{'group_by': 'area_level'}" />
136+
<filter
137+
name="grp_parent"
138+
string="Parent"
139+
context="{'group_by': 'parent_id'}"
140+
/>
141+
<filter
142+
name="grp_level"
143+
string="Level"
144+
context="{'group_by': 'area_level'}"
145+
/>
111146
</search>
112147
</field>
113148
</record>
@@ -123,7 +158,8 @@
123158
<field name="help" type="html">
124159
<p class="o_view_nocontent_smiling_face">
125160
Create a new Area!
126-
</p><p>
161+
</p>
162+
<p>
127163
Click the create button to enter the information of the Area.
128164
</p>
129165
</field>
@@ -151,7 +187,12 @@
151187
sequence="0"
152188
/>
153189

154-
<menuitem id="area_main_top_menu" name="Areas" parent="area_main_menu_root" sequence="10" />
190+
<menuitem
191+
id="area_main_top_menu"
192+
name="Areas"
193+
parent="area_main_menu_root"
194+
sequence="10"
195+
/>
155196

156197
<menuitem
157198
id="menu_spparea"

spp_gis_report/views/area_views.xml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@ Part of OpenSPP. See LICENSE file for full copyright and licensing details.
1818
<separator string="Reference Data for GIS Reports" />
1919
<group name="gis_reference_data" col="2">
2020
<group name="population_group">
21-
<field name="population" />
22-
<field name="population_date" />
23-
<field name="population_source" />
21+
<field
22+
name="population"
23+
help="Total population from census or official estimate. Used for per-capita normalization in GIS reports."
24+
/>
25+
<field
26+
name="population_date"
27+
help="Date when the population data was collected or published."
28+
/>
29+
<field
30+
name="population_source"
31+
help="Source of the population data, e.g., 'National Census 2020' or 'UNFPA Estimate'."
32+
/>
2433
</group>
2534
<group name="household_group">
26-
<field name="household_count" />
35+
<field
36+
name="household_count"
37+
help="Number of households in this area. Used for per-household normalization in GIS reports."
38+
/>
2739
</group>
2840
</group>
2941
</xpath>

0 commit comments

Comments
 (0)