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