From e6c760fea2da6c7634bfe3745d1ce6a054e6e7b6 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Thu, 27 Jun 2019 15:30:12 +0200 Subject: [PATCH] =?UTF-8?q?[bnporc/pp]=20Corrected=20investments=20retrive?= =?UTF-8?q?=20on=20PEA=20'Esp=C3=A8ces'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First, the word 'Espèces' is not necessarily at the end of the account label, so checking with 'Espèces' in account.label is more appropriate than the endswith(). Second, we should not return [] for PEA Espèces but rather the account balance as liquidities. Closes: 11641@zendesk --- modules/bnporc/pp/browser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/bnporc/pp/browser.py b/modules/bnporc/pp/browser.py index 33324a82ce..2820367e55 100644 --- a/modules/bnporc/pp/browser.py +++ b/modules/bnporc/pp/browser.py @@ -38,6 +38,7 @@ from weboob.browser.elements import DataError from weboob.exceptions import BrowserIncorrectPassword from weboob.tools.value import Value, ValueBool +from weboob.tools.capabilities.bank.investments import create_french_liquidity from .pages import ( LoginPage, AccountsPage, AccountsIBANPage, HistoryPage, TransferInitPage, @@ -286,8 +287,8 @@ def iter_coming_operations(self, account): @need_login def iter_investment(self, account): - if account.type == Account.TYPE_PEA and account.label.endswith('Espèces'): - return [] + if account.type == Account.TYPE_PEA and 'espèces' in account.label.lower(): + return [create_french_liquidity(account.balance)] # Life insurances and PERP may be scraped from the API or from the "Assurance Vie" space, # so we need to discriminate between both using account._details: -- GitLab