[boobank][fortuneo] No liquidity returned for stock market account
I recently began to use woob to automate several things on different bank accounts.
I realized using fortuneo backend that liquidity were not returned for stock market accounts while it is for PEA accounts.
After digging into source code I realized that it may be wanted, so it may not be a real issue but I don't understand the need of filtering liquidity for stock market account.
With which module do you encounter problems?
fortuneo
Describe the problem you encounter
iter_investments
function from FortuneoBrowser
class doesn't create liquidity for TYPE_MARKET
account type
Paste here the stacktrace or error message you observe
For PEA account
bank> investment <pea-id>
Label Code Quantity Unit Value Valuation diff
-------------------------------+--------------+------------+------------+------------+---------
AAA (AAA) AAAAAAAAAAAA aa aa.aa AAAA.AA aaa.aa
BBB (BBB) BBBBBBBBBBBB bb bb.bb BBBB.BB bbb.bb
CCC (CCC) CCCCCCCCCCCC cc cc.cc CCCC.CC ccc.cc
Liquidités XX-liquidity --- --- XXXX.XX ---
-------------------------------+--------------+------------+------------+------------+---------
Total total total2
For stock market account
bank> investment <stock-id>
Label Code Quantity Unit Value Valuation diff
-------------------------------+--------------+------------+------------+------------+---------
AAA (AAA) AAAAAAAAAAAA aa aa.aa AAAA.AA aaa.aa
BBB (BBB) BBBBBBBBBBBB bb bb.bb BBBB.BB bbb.bb
CCC (CCC) CCCCCCCCCCCC cc cc.cc CCCC.CC ccc.cc
-------------------------------+--------------+------------+------------+------------+---------
Total total total2
What are the steps to reproduce the problem?
- Launch woob bank app
- Enter command
list
- Enter credentials
- Enter command
investment <stock-id>
, with 'stock-id' beeing the index of stock market account - Liquidities doesn't appear
What woob version are you using?
$ woob config --version
Woob config v2.1 Copyright(C) 2010-2021 Christophe Benz, Romain Bignon
What module version are you using?
$ woob config info fortuneo
.------------------------------------------------------------------------------.
| Module fortuneo |
+-----------------.------------------------------------------------------------'
| Version | 202102121848
| Maintainer | Gilles-Alexandre Quenot <gilles.quenot@gmail.com>
| License | LGPLv3+
| Description | Fortuneo
| Capabilities | CapBank, CapBankTransfer, CapProfile, CapTransfer, CapBankTransferAddRecipient, CapBankWealth, CapCollection
| Installed | yes
| Location | https://updates.woob.tech/2.1/main/fortuneo.tar.gz
| |
| Configuration | login: Identifiant (default: )
| | password: Mot de passe (default: )
| | code: None
| | request_information: None
'-----------------'
How did you install woob?
sudo setup.py install
Additional info you'd like to mention
After looking at the fortuneo module code I seen that TYPE_MARKET account were filtered-out for liquidity creation.
After removing the condition, investment
command returns liquidity as expected for stock market account.
diff --git a/modules/fortuneo/browser.py b/modules/fortuneo/browser.py
index 7d7df231f..824975827 100644
--- a/modules/fortuneo/browser.py
+++ b/modules/fortuneo/browser.py
@@ -287,7 +287,7 @@ def iter_investments(self, account):
for inv in self.page.iter_investments():
yield inv
- if self.pea_history.is_here() and account.type != account.TYPE_MARKET:
+ if self.pea_history.is_here():
liquidity = self.page.get_liquidity()
if liquidity:
yield create_french_liquidity(liquidity)
- Why TYPE_MARKET is filtered-out for liquidity creation ?
- Is it possible to add a configuration option to handle this case ?
- Is it possible to remove this filter is it's not useful anymore ?
If TYPE_MARKET is filtered for a good reason, is there a way to reapply this patch at every module update so this workaround stays active without having to manually apply the patch every time a module is updated ?
Thanks in advance for your support.