Ejemplo n.º 1
0
 def setup_proxies(self):
     repeat_types = get_interval_type_items(with_multiples=True,
                                            adverb=True)
     repeat_types.insert(0, (_('Once'), _ONCE))
     self.repeat.prefill(repeat_types)
     is_paid = self.model.is_paid()
     # Show account information only after the payment is paid
     if is_paid:
         accounts = Account.get_accounts(self.store)
         self.account.prefill(api.for_combo(accounts, attr='long_description'))
         if self.payment_type == Payment.TYPE_OUT:
             account = self.model.transaction.source_account
         else:
             account = self.model.transaction.account
         self.account.select(account)
         self.account.set_property('sensitive', False)
     else:
         self.account.hide()
         self.account_lbl.hide()
     self.add_proxy(self.model, _PaymentEditor.proxy_widgets)
Ejemplo n.º 2
0
 def setup_proxies(self):
     repeat_types = get_interval_type_items(with_multiples=True,
                                            adverb=True)
     repeat_types.insert(0, (_('Once'), _ONCE))
     self.repeat.prefill(repeat_types)
     is_paid = self.model.is_paid()
     # Show account information only after the payment is paid
     if is_paid:
         accounts = Account.get_accounts(self.store)
         self.account.prefill(
             api.for_combo(accounts, attr='long_description'))
         if self.payment_type == Payment.TYPE_OUT:
             account = self.model.transaction.source_account
         else:
             account = self.model.transaction.account
         self.account.select(account)
         self.account.set_property('sensitive', False)
     else:
         self.account.hide()
         self.account_lbl.hide()
     self.add_proxy(self.model, _PaymentEditor.proxy_widgets)
Ejemplo n.º 3
0
def test_account_get_accounts(store, example_creator):
    account = example_creator.create_account()

    accounts = list(Account.get_accounts(store))
    assert account in accounts
    assert accounts == list(store.find(Account))
Ejemplo n.º 4
0
 def _get_account_options(self):
     return [(ac.description, ac)
             for ac in Account.get_accounts(self.store)]