Commit 08071916 authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'upstream/master' into zope4py2

parents ea0850ca 784c5ab2
...@@ -70,12 +70,14 @@ bank_account_list = [brain.getObject() for brain in sorted( ...@@ -70,12 +70,14 @@ bank_account_list = [brain.getObject() for brain in sorted(
)] )]
def getItemList(bank_account): def getItemList(bank_account, warning=False):
reference = bank_account.getReference() reference = bank_account.getReference()
title = bank_account.getTitle() or bank_account.getSourceFreeText() or bank_account.getSourceTitle() title = bank_account.getTitle() or bank_account.getSourceFreeText() or bank_account.getSourceTitle()
label = title label = title
if reference != title: if reference != title:
label = '{} - {}'.format(reference, title) label = '{} - {}'.format(reference, title)
if warning:
label = '??? ({})'.format(label)
return (label, bank_account.getRelativeUrl()) return (label, bank_account.getRelativeUrl())
...@@ -98,6 +100,6 @@ if base_category is not None: ...@@ -98,6 +100,6 @@ if base_category is not None:
translateString( translateString(
'Invalid bank account from ${entity_title}', 'Invalid bank account from ${entity_title}',
mapping={'entity_title': current_value.getParentTitle()}), None)) mapping={'entity_title': current_value.getParentTitle()}), None))
item_list.append(getItemList(current_value)) item_list.append(getItemList(current_value, warning=True))
return item_list return item_list
...@@ -4988,7 +4988,7 @@ class TestTransactions(AccountingTestCase): ...@@ -4988,7 +4988,7 @@ class TestTransactions(AccountingTestCase):
[ [
('', ''), ('', ''),
('Invalid bank account from Client 1', None), ('Invalid bank account from Client 1', None),
('client_1 bank account', client_1_bank_account.getRelativeUrl()), ('??? (client_1 bank account)', client_1_bank_account.getRelativeUrl()),
], ],
) )
...@@ -5013,7 +5013,7 @@ class TestTransactions(AccountingTestCase): ...@@ -5013,7 +5013,7 @@ class TestTransactions(AccountingTestCase):
[ [
('', ''), ('', ''),
('Invalid bank account from Client 1', None), ('Invalid bank account from Client 1', None),
('client_1 bank account', client_1_bank_account.getRelativeUrl()), ('??? (client_1 bank account)', client_1_bank_account.getRelativeUrl()),
], ],
) )
......
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