Commit e6c760fe authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by ntome

[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 ...@@ -38,6 +38,7 @@ from weboob.browser.exceptions import ServerError
from weboob.browser.elements import DataError from weboob.browser.elements import DataError
from weboob.exceptions import BrowserIncorrectPassword from weboob.exceptions import BrowserIncorrectPassword
from weboob.tools.value import Value, ValueBool from weboob.tools.value import Value, ValueBool
from weboob.tools.capabilities.bank.investments import create_french_liquidity
from .pages import ( from .pages import (
LoginPage, AccountsPage, AccountsIBANPage, HistoryPage, TransferInitPage, LoginPage, AccountsPage, AccountsIBANPage, HistoryPage, TransferInitPage,
...@@ -286,8 +287,8 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser): ...@@ -286,8 +287,8 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
@need_login @need_login
def iter_investment(self, account): def iter_investment(self, account):
if account.type == Account.TYPE_PEA and account.label.endswith('Espèces'): if account.type == Account.TYPE_PEA and 'espèces' in account.label.lower():
return [] return [create_french_liquidity(account.balance)]
# Life insurances and PERP may be scraped from the API or from the "Assurance Vie" space, # 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: # 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