Skip to content

Commit cbf83fd

Browse files
committed
Merge remote-tracking branch 'origin/19.0' into feat/876-create-group-cr-redesign
# Conflicts: # spp_change_request_v2/README.rst # spp_change_request_v2/__manifest__.py # spp_change_request_v2/readme/HISTORY.md # spp_change_request_v2/static/description/index.html # spp_mis_demo_v2/README.rst # spp_mis_demo_v2/readme/HISTORY.md # spp_mis_demo_v2/static/description/index.html
2 parents ed72c19 + fd1eb1b commit cbf83fd

25 files changed

Lines changed: 273 additions & 130 deletions

File tree

spp_change_request_v2/README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,16 @@ Changelog
874874
``relationship_id``); downstream modules that extended the old flow
875875
must adapt (see #1133).
876876

877+
19.0.2.0.8
878+
~~~~~~~~~~
879+
880+
- fix(views): disable inline creation of CR document types on the Change
881+
Request Type "Documents" tab — the ``Available Documents`` field now
882+
only selects existing ``cr_document_type`` vocabulary codes
883+
(``no_create`` / ``no_quick_create``), matching
884+
``Required Documents``. This removes the broken "Create Available
885+
Documents" modal (missing Name field) that blocked saving (#1125)
886+
877887
19.0.2.0.7
878888
~~~~~~~~~~
879889

spp_change_request_v2/readme/HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
- fix(change_request): Split Household "New Household Information" shows a fillable Address field, and the new-household **Latitude/Longitude** are surfaced with an interactive **map** (`spp_gis`, OSM basemap) to pick/preview the location — the two stay in sync and out-of-range coordinates are rejected. The review page surfaces the coordinates plus the new household's Phone / Bank / ID lines as tables (#877)
55
- **Breaking:** the Add Member detail no longer exposes the create-a-new-individual fields (`created_individual_id`, `given_name`, `family_name`, `birthdate`, `gender_id`, `relationship_id`); downstream modules that extended the old flow must adapt (see #1133).
66

7+
### 19.0.2.0.8
8+
9+
- fix(views): disable inline creation of CR document types on the Change Request Type "Documents" tab — the `Available Documents` field now only selects existing `cr_document_type` vocabulary codes (`no_create` / `no_quick_create`), matching `Required Documents`. This removes the broken "Create Available Documents" modal (missing Name field) that blocked saving (#1125)
10+
711
### 19.0.2.0.7
812

913
- fix(security): align CR Requestor / CR Local Validator / CR HQ Validator roles with the OP#951 menu audit — replace the `spp_registry.group_registry_read` (Tier-3, no menu) link with `spp_registry.group_registry_viewer` so these roles see the Registry menu; add `spp_hazard.group_hazard_viewer` so they retain Hazard visibility once the menu root is gated. Adds `spp_hazard` to module dependencies.

spp_change_request_v2/static/description/index.html

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,17 @@ <h1>19.0.3.0.0</h1>
13611361
</ul>
13621362
</div>
13631363
<div class="section" id="section-2">
1364+
<h1>19.0.2.0.8</h1>
1365+
<ul class="simple">
1366+
<li>fix(views): disable inline creation of CR document types on the Change
1367+
Request Type “Documents” tab — the <tt class="docutils literal">Available Documents</tt> field now
1368+
only selects existing <tt class="docutils literal">cr_document_type</tt> vocabulary codes
1369+
(<tt class="docutils literal">no_create</tt> / <tt class="docutils literal">no_quick_create</tt>), matching
1370+
<tt class="docutils literal">Required Documents</tt>. This removes the broken “Create Available
1371+
Documents” modal (missing Name field) that blocked saving (#1125)</li>
1372+
</ul>
1373+
</div>
1374+
<div class="section" id="section-3">
13641375
<h1>19.0.2.0.7</h1>
13651376
<ul class="simple">
13661377
<li>fix(security): align CR Requestor / CR Local Validator / CR HQ
@@ -1372,7 +1383,7 @@ <h1>19.0.2.0.7</h1>
13721383
dependencies.</li>
13731384
</ul>
13741385
</div>
1375-
<div class="section" id="section-3">
1386+
<div class="section" id="section-4">
13761387
<h1>19.0.2.0.6</h1>
13771388
<ul class="simple">
13781389
<li>fix(views): route post-submit CRs (pending / approved / applied /
@@ -1387,7 +1398,7 @@ <h1>19.0.2.0.6</h1>
13871398
list so row-click goes through the stage router.</li>
13881399
</ul>
13891400
</div>
1390-
<div class="section" id="section-4">
1401+
<div class="section" id="section-5">
13911402
<h1>19.0.2.0.5</h1>
13921403
<ul class="simple">
13931404
<li>fix(security): add a global <tt class="docutils literal">ir.rule</tt> on <tt class="docutils literal">spp.change.request</tt> that
@@ -1400,27 +1411,27 @@ <h1>19.0.2.0.5</h1>
14001411
roles).</li>
14011412
</ul>
14021413
</div>
1403-
<div class="section" id="section-5">
1414+
<div class="section" id="section-6">
14041415
<h1>19.0.2.0.3</h1>
14051416
<ul class="simple">
14061417
<li>fix: add HTML escaping to all computed Html fields with
14071418
<tt class="docutils literal">sanitize=False</tt> to prevent stored XSS (#50)</li>
14081419
</ul>
14091420
</div>
1410-
<div class="section" id="section-6">
1421+
<div class="section" id="section-7">
14111422
<h1>19.0.2.0.2</h1>
14121423
<ul class="simple">
14131424
<li>fix: fix batch approval wizard line deletion (#130)</li>
14141425
</ul>
14151426
</div>
1416-
<div class="section" id="section-7">
1427+
<div class="section" id="section-8">
14171428
<h1>19.0.2.0.1</h1>
14181429
<ul class="simple">
14191430
<li>fix: skip field types before getattr and isolate detail prefetch
14201431
(#129)</li>
14211432
</ul>
14221433
</div>
1423-
<div class="section" id="section-8">
1434+
<div class="section" id="section-9">
14241435
<h1>19.0.2.0.0</h1>
14251436
<ul class="simple">
14261437
<li>Initial migration to OpenSPP2</li>

spp_change_request_v2/views/change_request_type_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
name="available_document_ids"
231231
widget="many2many_tags"
232232
placeholder="Select which document types can be uploaded..."
233-
context="{'default_vocabulary_id': %(spp_vocabulary.vocabulary_cr_document_type)d}"
233+
options="{'no_create': True, 'no_quick_create': True}"
234234
/>
235235
<field
236236
name="required_document_ids"

spp_farmer_registry/README.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ Model Description
6868
Changelog
6969
=========
7070

71+
19.0.2.0.3
72+
~~~~~~~~~~
73+
74+
- fix(farm): remove the farm membership-completeness warnings entirely —
75+
both the "No head member designated" and "No members linked to this
76+
group yet" banners, their "No Head Member" / "No Members" search
77+
filters, the ``member_count`` and head-member list columns, and the
78+
backing ``has_head_member`` / ``member_count`` computed fields. The
79+
head-member check misfired on farm groups that did have a head, and
80+
per #1113 no such warnings should be shown (#1113)
81+
7182
19.0.2.0.2
7283
~~~~~~~~~~
7384

spp_farmer_registry/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "OpenSPP Farmer Registry",
44
"summary": "Farmer Registry with vocabulary-based fields, CEL variables, and Logic Studio integration",
55
"category": "OpenSPP",
6-
"version": "19.0.2.0.2",
6+
"version": "19.0.2.0.3",
77
"sequence": 1,
88
"author": "OpenSPP.org",
99
"website": "https://github.com/OpenSPP/OpenSPP2",

spp_farmer_registry/models/farm.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -148,27 +148,6 @@ class Farm(models.Model):
148148
help="Sum of all livestock activity quantities",
149149
)
150150

151-
# ═══════════════════════════════════════════════════════════════════════
152-
# MEMBERSHIP COMPLETENESS (#939)
153-
# ═══════════════════════════════════════════════════════════════════════
154-
# Farm-registry users need to surface farms that aren't usable yet because
155-
# nobody is associated with them, or because no member is flagged as the
156-
# head of household. Stored so the search filters and list-row decoration
157-
# can use them without triggering N+1 reads.
158-
159-
member_count = fields.Integer(
160-
string="# Members",
161-
compute="_compute_member_membership_state",
162-
store=True,
163-
help="Number of non-ended members linked to this farm/group.",
164-
)
165-
has_head_member = fields.Boolean(
166-
string="Has Head Member",
167-
compute="_compute_member_membership_state",
168-
store=True,
169-
help="True when at least one non-ended member carries the 'head' membership type.",
170-
)
171-
172151
# ═══════════════════════════════════════════════════════════════════════
173152
# COMPUTED METHODS
174153
# ═══════════════════════════════════════════════════════════════════════
@@ -217,21 +196,6 @@ def _compute_total_livestock_heads(self):
217196
for record in self:
218197
record.total_livestock_heads = sum(act.quantity or 0 for act in record.farm_livestock_act_ids)
219198

220-
@api.depends(
221-
"group_membership_ids",
222-
"group_membership_ids.is_ended",
223-
"group_membership_ids.membership_type_ids",
224-
)
225-
def _compute_member_membership_state(self):
226-
"""Compute member_count and has_head_member from non-ended memberships."""
227-
head_code = self.env["spp.vocabulary.code"].get_code("urn:openspp:vocab:group-membership-type", "head")
228-
for record in self:
229-
active_members = record.group_membership_ids.filtered(lambda m: not m.is_ended)
230-
record.member_count = len(active_members)
231-
record.has_head_member = bool(
232-
head_code and active_members.filtered(lambda m: head_code in m.membership_type_ids)
233-
)
234-
235199
# ═══════════════════════════════════════════════════════════════════════
236200
# HELPER METHODS
237201
# ═══════════════════════════════════════════════════════════════════════

spp_farmer_registry/readme/HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 19.0.2.0.3
2+
3+
- fix(farm): remove the farm membership-completeness warnings entirely — both the "No head member designated" and "No members linked to this group yet" banners, their "No Head Member" / "No Members" search filters, the `member_count` and head-member list columns, and the backing `has_head_member` / `member_count` computed fields. The head-member check misfired on farm groups that did have a head, and per #1113 no such warnings should be shown (#1113)
4+
15
### 19.0.2.0.2
26

37
- fix(security): align Farm User / Farm Manager roles with the OP#951 menu audit — both farm roles now imply `spp_hazard.group_hazard_viewer` and `spp_gis_report.group_gis_report_user` so they retain Hazard and GIS Reports menu visibility once those menu roots are gated. Adds `spp_hazard` and `spp_gis_report` to module dependencies.

spp_farmer_registry/static/description/index.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,18 @@ <h2><a class="toc-backref" href="#toc-entry-1">Changelog</a></h2>
436436
</div>
437437
</div>
438438
<div class="section" id="section-1">
439+
<h1>19.0.2.0.3</h1>
440+
<ul class="simple">
441+
<li>fix(farm): remove the farm membership-completeness warnings entirely —
442+
both the “No head member designated” and “No members linked to this
443+
group yet” banners, their “No Head Member” / “No Members” search
444+
filters, the <tt class="docutils literal">member_count</tt> and head-member list columns, and the
445+
backing <tt class="docutils literal">has_head_member</tt> / <tt class="docutils literal">member_count</tt> computed fields. The
446+
head-member check misfired on farm groups that did have a head, and
447+
per #1113 no such warnings should be shown (#1113)</li>
448+
</ul>
449+
</div>
450+
<div class="section" id="section-2">
439451
<h1>19.0.2.0.2</h1>
440452
<ul class="simple">
441453
<li>fix(security): align Farm User / Farm Manager roles with the OP#951
@@ -446,15 +458,15 @@ <h1>19.0.2.0.2</h1>
446458
<tt class="docutils literal">spp_hazard</tt> and <tt class="docutils literal">spp_gis_report</tt> to module dependencies.</li>
447459
</ul>
448460
</div>
449-
<div class="section" id="section-2">
461+
<div class="section" id="section-3">
450462
<h1>19.0.2.0.1</h1>
451463
<ul class="simple">
452464
<li>fix(views): apply <tt class="docutils literal">spp_registry.x2many_no_padding</tt> widget to the
453465
farm activities list on farm forms — removes the four empty
454466
placeholder rows Odoo 19 inserts on inline list-in-form views (#943).</li>
455467
</ul>
456468
</div>
457-
<div class="section" id="section-3">
469+
<div class="section" id="section-4">
458470
<h1>19.0.2.0.0</h1>
459471
<ul class="simple">
460472
<li>Initial migration to OpenSPP2</li>

spp_farmer_registry/views/farm_views.xml

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -222,81 +222,6 @@
222222
</field>
223223
</record>
224224

225-
<!-- ═══════════════════════════════════════════════════════════════════════
226-
Farm membership-completeness UX (#939)
227-
═══════════════════════════════════════════════════════════════════════ -->
228-
229-
<!-- Search filters: surface farms with no members or no head member -->
230-
<record id="view_registry_groups_filter_farm" model="ir.ui.view">
231-
<field name="name">res.partner.search.farm.member_completeness</field>
232-
<field name="model">res.partner</field>
233-
<field name="inherit_id" ref="spp_registry.view_registry_groups_filter" />
234-
<field name="priority">50</field>
235-
<field name="arch" type="xml">
236-
<xpath expr="//filter[@name='has_phone']" position="after">
237-
<separator />
238-
<filter
239-
string="No Members"
240-
name="no_members"
241-
domain="[('member_count', '=', 0)]"
242-
/>
243-
<filter
244-
string="No Head Member"
245-
name="no_head_member"
246-
domain="[('has_head_member', '=', False)]"
247-
/>
248-
</xpath>
249-
</field>
250-
</record>
251-
252-
<!-- List view: warning decoration + optional column for member count.
253-
The decoration scopes to farm records (those with farm_type_id set)
254-
so it doesn't fire on plain group registrants. -->
255-
<record id="view_groups_list_tree_farm" model="ir.ui.view">
256-
<field name="name">res.partner.list.farm.member_completeness</field>
257-
<field name="model">res.partner</field>
258-
<field name="inherit_id" ref="spp_registry.view_groups_list_tree" />
259-
<field name="priority">50</field>
260-
<field name="arch" type="xml">
261-
<xpath expr="//list" position="inside">
262-
<field name="member_count" optional="hide" />
263-
<field name="has_head_member" optional="hide" widget="boolean" />
264-
</xpath>
265-
</field>
266-
</record>
267-
268-
<!-- Form-top banners: warn when a group has no members, or has members
269-
but no designated head. The two banners are mutually exclusive:
270-
no-members fires only when member_count == 0; no-head fires only
271-
when there are members but none flagged as head. Scoped to
272-
is_group so neither appears on individuals. -->
273-
<record id="view_individuals_form_farm_no_members" model="ir.ui.view">
274-
<field name="name">res.partner.form.farm.member_completeness_banners</field>
275-
<field name="model">res.partner</field>
276-
<field name="inherit_id" ref="spp_registry.view_individuals_form" />
277-
<field name="priority">50</field>
278-
<field name="arch" type="xml">
279-
<xpath expr="//div[@name='button_box']" position="before">
280-
<div
281-
class="alert alert-warning text-center"
282-
role="alert"
283-
invisible="not is_group or member_count != 0"
284-
>
285-
<i class="fa fa-exclamation-triangle me-2" title="Warning" />
286-
No members linked to this group yet.
287-
</div>
288-
<div
289-
class="alert alert-danger text-center"
290-
role="alert"
291-
invisible="not is_group or member_count == 0 or has_head_member"
292-
>
293-
<i class="fa fa-exclamation-triangle me-2" title="Warning" />
294-
No head member designated.
295-
</div>
296-
</xpath>
297-
</field>
298-
</record>
299-
300225
<!-- Add view activity actions to res.partner -->
301226
<record id="res_partner_view_crop_activities" model="ir.actions.server">
302227
<field name="name">View Crop Activities</field>

0 commit comments

Comments
 (0)