Commit f692aa61 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_bank_reconciliation] Rename your_mode field, to prevent naming conflict in hal

parent 33b8e920
...@@ -13,7 +13,7 @@ kw = { ...@@ -13,7 +13,7 @@ kw = {
} }
if mode == "reconcile": if reconciliation_mode == "reconcile":
if context.getStopDate(): if context.getStopDate():
kw['at_date'] = context.getStopDate().latestTime() kw['at_date'] = context.getStopDate().latestTime()
kw.update({ kw.update({
...@@ -22,7 +22,7 @@ if mode == "reconcile": ...@@ -22,7 +22,7 @@ if mode == "reconcile":
'left_join_list': ['aggregate_bank_reconciliation_date'], 'left_join_list': ['aggregate_bank_reconciliation_date'],
'implicit_join': False, }) 'implicit_join': False, })
else: else:
assert mode == "unreconcile" assert reconciliation_mode == "unreconcile"
kw['aggregate_bank_reconciliation_uid'] = context.getUid() kw['aggregate_bank_reconciliation_uid'] = context.getUid()
# Handle search params # Handle search params
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>mode="reconcile", *args, **listbox_kw</string> </value> <value> <string>reconciliation_mode="reconcile", *args, **listbox_kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -19,13 +19,13 @@ if request.get('show_reconcilied', True): ...@@ -19,13 +19,13 @@ if request.get('show_reconcilied', True):
path=context.getPhysicalPath(), path=context.getPhysicalPath(),
selection_name="bank_reconciliation_report_selection", selection_name="bank_reconciliation_report_selection",
selection_params={'title': 'Reconciled Transactions', selection_params={'title': 'Reconciled Transactions',
'mode': 'unreconcile'})) 'reconciliation_mode': 'unreconcile'}))
if request.get('show_non_reconcilied', True): if request.get('show_non_reconcilied', True):
report_section_list.append( report_section_list.append(
ReportSection(form_id='BankReconciliation_viewBankReconciliationReportSection', ReportSection(form_id='BankReconciliation_viewBankReconciliationReportSection',
selection_name="bank_reconciliation_report_selection", selection_name="bank_reconciliation_report_selection",
path=context.getPhysicalPath(), path=context.getPhysicalPath(),
selection_params={'title': 'Not Reconciled Transactions', selection_params={'title': 'Not Reconciled Transactions',
'mode': 'reconcile'})) 'reconciliation_mode': 'reconcile'}))
return report_section_list return report_section_list
...@@ -7,7 +7,7 @@ selection_uid_list = portal.portal_selections.getSelectionCheckedUidsFor(list_se ...@@ -7,7 +7,7 @@ selection_uid_list = portal.portal_selections.getSelectionCheckedUidsFor(list_se
reconciled_bank_account = context.getSourcePayment() reconciled_bank_account = context.getSourcePayment()
if mode == 'reconcile': if reconciliation_mode == 'reconcile':
for line in portal.portal_catalog(uid=selection_uid_list or -1): for line in portal.portal_catalog(uid=selection_uid_list or -1):
line = line.getObject() line = line.getObject()
# Sanity check: line should not already be reconciled. # Sanity check: line should not already be reconciled.
...@@ -29,8 +29,8 @@ if mode == 'reconcile': ...@@ -29,8 +29,8 @@ if mode == 'reconcile':
'portal_status_message': translateString("Line Already Reconciled"), 'portal_status_message': translateString("Line Already Reconciled"),
'reset': 1, 'reset': 1,
'cancel_url': cancel_url, 'cancel_url': cancel_url,
'mode': mode, 'reconciliation_mode': reconciliation_mode,
'field_your_mode': mode}) 'field_your_reconciliation_mode': reconciliation_mode})
line.AccountingTransactionLine_addBankReconciliation( line.AccountingTransactionLine_addBankReconciliation(
context.getRelativeUrl(), context.getRelativeUrl(),
message=translateString("Reconciling Bank Line")) message=translateString("Reconciling Bank Line"))
...@@ -38,11 +38,11 @@ if mode == 'reconcile': ...@@ -38,11 +38,11 @@ if mode == 'reconcile':
'portal_status_message': translateString("Lines Reconciled"), 'portal_status_message': translateString("Lines Reconciled"),
'reset': 1, 'reset': 1,
'cancel_url': cancel_url, 'cancel_url': cancel_url,
'field_your_mode': mode, 'field_your_reconciliation_mode': reconciliation_mode,
'mode': mode, 'reconciliation_mode': reconciliation_mode,
'reconciled_uid_list': selection_uid_list}) 'reconciled_uid_list': selection_uid_list})
assert mode == 'unreconcile' assert reconciliation_mode == 'unreconcile'
for line in portal.portal_catalog(uid=selection_uid_list or -1): for line in portal.portal_catalog(uid=selection_uid_list or -1):
line = line.getObject() line = line.getObject()
line.AccountingTransactionLine_removeBankReconciliation( line.AccountingTransactionLine_removeBankReconciliation(
...@@ -53,6 +53,6 @@ return context.Base_redirect(dialog_id, keep_items={ ...@@ -53,6 +53,6 @@ return context.Base_redirect(dialog_id, keep_items={
'portal_status_message': translateString("Lines Unreconciled"), 'portal_status_message': translateString("Lines Unreconciled"),
'reset': 1, 'reset': 1,
'cancel_url': cancel_url, 'cancel_url': cancel_url,
'field_your_mode': mode, 'field_your_reconciliation_mode': reconciliation_mode,
'mode': mode, 'reconciliation_mode': reconciliation_mode,
'reconciled_uid_list': selection_uid_list}) 'reconciled_uid_list': selection_uid_list})
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>mode="reconcile", list_selection_name="", uids=(), listbox_uid=(), dialog_id=None, cancel_url=None, **kw</string> </value> <value> <string>reconciliation_mode="reconcile", list_selection_name="", uids=(), listbox_uid=(), dialog_id=None, cancel_url=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list>
<string>your_mode</string> <string>your_reconciliation_mode</string>
<string>my_stop_date</string> <string>my_stop_date</string>
</list> </list>
</value> </value>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_mode</string> </value> <value> <string>your_reconciliation_mode</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
<string>View</string> <string>View</string>
</tuple> </tuple>
<tuple> <tuple>
<string>mode</string> <string>reconciliation_mode</string>
<string>unreconcile</string> <string>unreconcile</string>
</tuple> </tuple>
</list> </list>
......
...@@ -136,7 +136,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase): ...@@ -136,7 +136,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase):
# This listbox can also be used to unreconcile some previously reconciled # This listbox can also be used to unreconcile some previously reconciled
# transactions. # transactions.
line_list = bank_reconciliation.BankReconciliation_getAccountingTransactionLineList( line_list = bank_reconciliation.BankReconciliation_getAccountingTransactionLineList(
mode="unreconcile", reconciliation_mode="unreconcile",
) )
self.assertEqual([payment1.bank, ], self.assertEqual([payment1.bank, ],
[line.getObject() for line in line_list]) [line.getObject() for line in line_list])
...@@ -258,7 +258,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase): ...@@ -258,7 +258,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase):
bank_reconciliation.BankReconciliation_reconcileTransactionList( bank_reconciliation.BankReconciliation_reconcileTransactionList(
list_selection_name=list_selection_name, list_selection_name=list_selection_name,
uids=(payment1.bank.getUid(),), uids=(payment1.bank.getUid(),),
mode='reconcile') reconciliation_mode='reconcile')
self.tic() self.tic()
self.assertEqual(bank_reconciliation, payment1.bank.getAggregateValue()) self.assertEqual(bank_reconciliation, payment1.bank.getAggregateValue())
...@@ -274,7 +274,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase): ...@@ -274,7 +274,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase):
bank_reconciliation.BankReconciliation_reconcileTransactionList( bank_reconciliation.BankReconciliation_reconcileTransactionList(
list_selection_name=list_selection_name, list_selection_name=list_selection_name,
uids=(payment1.bank.getUid(),), uids=(payment1.bank.getUid(),),
mode='unreconcile') reconciliation_mode='unreconcile')
self.tic() self.tic()
self.assertEqual(None, payment1.bank.getAggregateValue()) self.assertEqual(None, payment1.bank.getAggregateValue())
...@@ -444,7 +444,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase): ...@@ -444,7 +444,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase):
self.assertEqual('BankReconciliation_view', report_section_list[0].form_id) self.assertEqual('BankReconciliation_view', report_section_list[0].form_id)
# Then we have the reconciled lines # Then we have the reconciled lines
self.assertEqual({'mode': 'unreconcile', self.assertEqual({'reconciliation_mode': 'unreconcile',
'title': 'Reconciled Transactions'}, 'title': 'Reconciled Transactions'},
report_section_list[1].selection_params) report_section_list[1].selection_params)
line_list = self.getListBoxLineList(report_section_list[1]) line_list = self.getListBoxLineList(report_section_list[1])
...@@ -455,7 +455,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase): ...@@ -455,7 +455,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase):
# And finally the non reconciled lines # And finally the non reconciled lines
line_list = self.getListBoxLineList(report_section_list[2]) line_list = self.getListBoxLineList(report_section_list[2])
self.assertEqual({'mode': 'reconcile', self.assertEqual({'reconciliation_mode': 'reconcile',
'title': 'Not Reconciled Transactions'}, 'title': 'Not Reconciled Transactions'},
report_section_list[2].selection_params) report_section_list[2].selection_params)
data_line_list = [l for l in line_list if l.isDataLine()] data_line_list = [l for l in line_list if l.isDataLine()]
...@@ -552,7 +552,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase): ...@@ -552,7 +552,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase):
bank_reconciliation.BankReconciliation_reconcileTransactionList( bank_reconciliation.BankReconciliation_reconcileTransactionList(
list_selection_name=list_selection_name, list_selection_name=list_selection_name,
uids=(payment1.bank.getUid(), ), uids=(payment1.bank.getUid(), ),
mode='reconcile') reconciliation_mode='reconcile')
self.tic() self.tic()
self.assertEqual(100, bank_reconciliation.BankReconciliation_getReconciledAccountBalance()) self.assertEqual(100, bank_reconciliation.BankReconciliation_getReconciledAccountBalance())
...@@ -631,7 +631,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase): ...@@ -631,7 +631,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase):
bank_reconciliation_for_section.BankReconciliation_reconcileTransactionList( bank_reconciliation_for_section.BankReconciliation_reconcileTransactionList(
list_selection_name=list_selection_name, list_selection_name=list_selection_name,
uids=(internal_transaction.bank.getUid(), ), uids=(internal_transaction.bank.getUid(), ),
mode='reconcile') reconciliation_mode='reconcile')
self.tic() self.tic()
# reconciled for `section` # reconciled for `section`
self.assertEqual(100, bank_reconciliation_for_section.BankReconciliation_getReconciledAccountBalance()) self.assertEqual(100, bank_reconciliation_for_section.BankReconciliation_getReconciledAccountBalance())
...@@ -657,7 +657,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase): ...@@ -657,7 +657,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase):
bank_reconciliation_for_main_section.BankReconciliation_reconcileTransactionList( bank_reconciliation_for_main_section.BankReconciliation_reconcileTransactionList(
list_selection_name=list_selection_name, list_selection_name=list_selection_name,
uids=(internal_transaction.bank.getUid(), ), uids=(internal_transaction.bank.getUid(), ),
mode='reconcile') reconciliation_mode='reconcile')
self.tic() self.tic()
# Reconciled for `main_section` # Reconciled for `main_section`
self.assertEqual(-100, bank_reconciliation_for_main_section.BankReconciliation_getReconciledAccountBalance()) self.assertEqual(-100, bank_reconciliation_for_main_section.BankReconciliation_getReconciledAccountBalance())
...@@ -684,7 +684,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase): ...@@ -684,7 +684,7 @@ class TestBankReconciliation(AccountingTestCase, ERP5ReportTestCase):
bank_reconciliation_for_section.BankReconciliation_reconcileTransactionList( bank_reconciliation_for_section.BankReconciliation_reconcileTransactionList(
list_selection_name=list_selection_name, list_selection_name=list_selection_name,
uids=(internal_transaction.bank.getUid(), ), uids=(internal_transaction.bank.getUid(), ),
mode='unreconcile') reconciliation_mode='unreconcile')
self.tic() self.tic()
# no longer reconciled for `section` # no longer reconciled for `section`
self.assertEqual(0, bank_reconciliation_for_section.BankReconciliation_getReconciledAccountBalance()) self.assertEqual(0, bank_reconciliation_for_section.BankReconciliation_getReconciledAccountBalance())
......
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