Ignore:
Timestamp:
10 Jul 2022, 11:47:16 (2 years ago)
Author:
Henrik Bettermann
Message:

Disable applicant balance payments in base package completely.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r17017 r17018  
    10671067    manage_applications = True
    10681068    pnav = 3
    1069     display_actions = [[_('Save'), _('Finally Submit')],
    1070         [_('Add online payment ticket'),
    1071          _('Add balance payment ticket'),
    1072          _('Remove selected tickets')]]
     1069   
     1070    @property
     1071    def display_actions(self):
     1072        actions = [[_('Save'), _('Finally Submit')],
     1073                   [_('Add online payment ticket'),
     1074                    _('Add balance payment ticket'),
     1075                    _('Remove selected tickets')]]
     1076        applicants_utils = getUtility(IApplicantsUtils)
     1077        if self.context.state not in applicants_utils.BALANCE_PAYMENT_STATES:
     1078            actions[1].pop(1)
     1079        return actions
    10731080
    10741081    @property
     
    12881295    submit_state = PAID
    12891296    mandate_days = 31
    1290     balance_payments_states = ()  # not used in base packe
    12911297
    12921298    @property
     
    13271333            actions = [[_('Save'), _('Finally Submit')],
    13281334                [_('Remove selected tickets')]]
    1329         if self.context.state in self.balance_payments_states:
     1335        applicants_utils = getUtility(IApplicantsUtils)
     1336        if self.context.state in applicants_utils.BALANCE_PAYMENT_STATES:
    13301337            actions[1].append(_('Add balance payment ticket'))
    13311338        return actions
Note: See TracChangeset for help on using the changeset viewer.