Commit a0022fe8 authored by Maxime Pommier's avatar Maxime Pommier Committed by Vincent A

[hsbc] Add accountownership

parent ee9356a1
......@@ -25,7 +25,7 @@ from lxml.etree import XMLSyntaxError
from collections import OrderedDict
from import LinearDateGuesser
from import Account, AccountNotFound
from import Account, AccountNotFound, AccountOwnership
from import sorted_transactions, keep_only_card_transactions
from import parse_qsl, urlparse
from weboob.exceptions import BrowserIncorrectPassword
......@@ -223,6 +223,12 @@ class HSBC(LoginBrowser):
for a in self.accounts_dict[owner].values():
a._owner = owner
# The first space is the PSU owner space
if owner == 0:
a.ownership = AccountOwnership.OWNER
a.ownership = AccountOwnership.ATTORNEY
# go on cards page if there are cards accounts
for a in self.accounts_dict[owner].values():
if a.type == Account.TYPE_CARD:
......@@ -253,6 +259,9 @@ class HSBC(LoginBrowser):
for account in owner.values():
if not in self.unique_accounts_dict.keys():
self.unique_accounts_dict[] = account
# If an account is in multiple space, that's mean it is shared between this owners.
self.unique_accounts_dict[].ownership = AccountOwnership.CO_OWNER
if self.unique_accounts_dict:
for account in self.unique_accounts_dict.values():
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