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)
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)
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))
def _get_account_options(self): return [(ac.description, ac) for ac in Account.get_accounts(self.store)]