Commit e6c760fe authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Vincent A

[bnporc/pp] Corrected investments retrive on PEA 'Espèces'

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
parent 387a3e3c
......@@ -38,6 +38,7 @@ from weboob.browser.exceptions import ServerError
from weboob.browser.elements import DataError
from weboob.exceptions import BrowserIncorrectPassword
from import Value, ValueBool
from import create_french_liquidity
from .pages import (
LoginPage, AccountsPage, AccountsIBANPage, HistoryPage, TransferInitPage,
......@@ -286,8 +287,8 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
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:
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