From 75fc29bdcd26bc44cf116db79e5c2b4c16d90f66 Mon Sep 17 00:00:00 2001 From: Florent Viard Date: Fri, 29 Jan 2021 22:23:06 +0100 Subject: [PATCH] [bp] Lowercase comparison of account holder name to determine ownership My accounts had the ownership incorrectly reported as "Attorney" instead of "Owner". The root cause is that the name fields in the profile page are all in uppercase but in the account name they are capitalized. --- modules/bp/pages/accountlist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/bp/pages/accountlist.py b/modules/bp/pages/accountlist.py index bc8437e0e1..b8a3c048b5 100644 --- a/modules/bp/pages/accountlist.py +++ b/modules/bp/pages/accountlist.py @@ -103,14 +103,14 @@ def obj_label(self): return CleanText('.//div[@class="title"]/h3')(self).upper() def obj_ownership(self): - account_holder = CleanText('.//div[@class="title"]/span')(self) + account_holder = CleanText('.//div[@class="title"]/span')(self).lower() pattern = re.compile( r'(m|mr|me|mme|mlle|mle|ml)\.? (.*)\bou ?(m|mr|me|mme|mlle|mle|ml)?\b(.*)', re.IGNORECASE ) if pattern.search(account_holder): return AccountOwnership.CO_OWNER - elif all(n in account_holder for n in self.env['name'].split(' ')): + elif all(n in account_holder for n in self.env['name'].lower().split(' ')): return AccountOwnership.OWNER else: return AccountOwnership.ATTORNEY -- GitLab