Commit 80141a14 authored by Florent Viard's avatar Florent Viard Committed by Vincent A

[bred] transfer recipients: Switch to the univers associated with an account

Listing recipients or the recipient of an account might not be possible
when in unrelated univers (spaces).

For example, it can't be done when inside the "immobilier" loan space.
parent 9c8b0326
......@@ -523,8 +523,11 @@ def fill_account(self, account, fields):
@need_login
def iter_transfer_recipients(self, account):
self.update_headers()
if account._univers != self.current_univers:
self.update_headers()
self.move_to_universe(account._univers)
self.update_headers()
try:
self.emitters_list.go(json={
'typeVirement': 'C',
......@@ -676,6 +679,8 @@ def init_new_recipient(self, recipient, **params):
@need_login
def init_transfer(self, transfer, account, recipient, **params):
self.move_to_universe(account._univers)
account_id = account.id.split('.')[0]
poste = account.id.split('.')[1]
......
......@@ -95,6 +95,9 @@ def fill_account(self, account, fields):
def iter_transfer_recipients(self, account):
if not isinstance(account, Account):
account = find_object(self.iter_accounts(), id=account)
elif not hasattr(account, '_univers'):
# We need a Bred filled Account to know the "univers" associated with the account
account = find_object(self.iter_accounts(), id=account.id)
return self.browser.iter_transfer_recipients(account)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment