diff --git a/modules/bred/bred/browser.py b/modules/bred/bred/browser.py index baaa402eb0b7c188887b9f5e6cbfad1957293306..e611202378a707ccb1b988e7c2d51bf75428b940 100644 --- a/modules/bred/bred/browser.py +++ b/modules/bred/bred/browser.py @@ -135,9 +135,6 @@ def get_loans_list(self): def get_list(self): self.accounts.go() for acc in self.page.iter_accounts(accnum=self.accnum, current_univers=self.current_univers): - if acc.type == Account.TYPE_CHECKING: - self.iban.go(number=acc._number) - self.page.set_iban(account=acc) yield acc @need_login @@ -227,3 +224,9 @@ def get_profile(self): self.page.set_email(profile=profile) return profile + + @need_login + def fill_account(self, account, fields): + if account.type == Account.TYPE_CHECKING and 'iban' in fields: + self.iban.go(number=account._number) + self.page.set_iban(account=account) diff --git a/modules/bred/module.py b/modules/bred/module.py index 8e6f016038dbd523620e81e0bfc931674f8332c4..5c1a6db726149f77c623c10cd19fefcf7229a5d7 100644 --- a/modules/bred/module.py +++ b/modules/bred/module.py @@ -18,7 +18,7 @@ # along with this weboob module. If not, see . -from weboob.capabilities.bank import CapBankWealth, AccountNotFound +from weboob.capabilities.bank import CapBankWealth, AccountNotFound, Account from weboob.capabilities.base import find_object from weboob.capabilities.profile import CapProfile from weboob.tools.backend import Module, BackendConfig @@ -73,3 +73,13 @@ def iter_investment(self, account): def get_profile(self): return self.browser.get_profile() + + def fill_account(self, account, fields): + if self.config['website'].get() != 'bred': + return + + self.browser.fill_account(account, fields) + + OBJECTS = { + Account: fill_account, + }