Skip to content

Commit d7e27fc

Browse files
committed
fix(spp_programs): Non-Compliant button opens only non-compliant cycles
The Non-Compliant smart button used the same action as the Cycles button, showing all cycle memberships. Added action_view_non_compliant_cycles that filters to state=non_compliant only.
1 parent c2216c3 commit d7e27fc

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

spp_programs/models/registrant.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,21 @@ def action_view_cycle_memberships(self):
201201
"context": {"default_partner_id": self.id},
202202
}
203203

204+
def action_view_non_compliant_cycles(self):
205+
"""Open non-compliant cycle memberships for this registrant."""
206+
self.ensure_one()
207+
return {
208+
"name": _("Non-Compliant Cycles - %s") % self.name,
209+
"type": "ir.actions.act_window",
210+
"res_model": "spp.cycle.membership",
211+
"view_mode": "list,form",
212+
"domain": [
213+
("partner_id", "=", self.id),
214+
("state", "=", "non_compliant"),
215+
],
216+
"context": {"default_partner_id": self.id},
217+
}
218+
204219
def action_view_all_entitlements(self):
205220
"""Open all entitlements (cash + in-kind) for this registrant."""
206221
self.ensure_one()

spp_programs/views/registrant_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Part of OpenSPP. See LICENSE file for full copyright and licensing details.
5454
/>
5555
</button>
5656
<button
57-
name="action_view_cycle_memberships"
57+
name="action_view_non_compliant_cycles"
5858
type="object"
5959
class="oe_stat_button"
6060
icon="fa-exclamation-triangle"

0 commit comments

Comments
 (0)