Skip to content

Commit

Permalink
G2P-1360 Buttons to follow logical flow - Approve Entitlements button…
Browse files Browse the repository at this point in the history
… should not be shown until Entitlements are prepared
  • Loading branch information
RamakrishnaVellala committed Dec 4, 2023
1 parent cfc2b9f commit 38942cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion g2p_programs/models/managers/payment_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def prepare_payments(self, cycle, entitlements=None):
payments, batches = self._prepare_payments(cycle, entitlements)
if payments:
kind = "success"
message = _("%s new payments was issued.", len(payments))
message = _(
"Payment batch successfully created for %s beneficiaries.",
len(payments),
)
sticky = False
else:
kind = "danger"
Expand Down
3 changes: 2 additions & 1 deletion g2p_programs/views/cycle_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
name="send_payment"
states="approved"
string="Send Payments"
invisible="context.get('hide_cash')"
attrs="{'invisible':['|',('payments_count','=',0)]}"
/>
<button
type="object"
Expand All @@ -100,6 +100,7 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
name="to_approve"
string="To Approve"
states="draft"
attrs="{'invisible': ['|',('entitlements_count', '=', 0)]}"
/>
<button
type="object"
Expand Down

0 comments on commit 38942cc

Please sign in to comment.