Commit 926e00a5 authored by Jérome Perrin's avatar Jérome Perrin

payment_mean: rename "mode" argument for erp5_hal_json compatibility

For same reasons as f692aa61 ([erp5_bank_reconciliation] Rename
your_mode field, to prevent naming conflict in hal, 2019-10-23)
parent aa927163
portal = context.getPortalObject() portal = context.getPortalObject()
if mode is None: if select_mode is None:
# To show an empty listbox the first time the dialog is open # To show an empty listbox the first time the dialog is open
container.REQUEST.set('PaymentTransactionGroup_statGroupablePaymentTransactionLineList.total_quantity', None)
return [] return []
elif mode == 'stopped_or_delivered': elif select_mode == 'stopped_or_delivered':
simulation_state = ('delivered', 'stopped') simulation_state = ('delivered', 'stopped')
else: else:
assert mode == 'planned_or_confirmed', "Unknown mode, %r" % mode assert select_mode == 'planned_or_confirmed', "Unknown select_mode, %r" % select_mode
simulation_state = ('planned', 'confirmed') simulation_state = ('planned', 'confirmed')
search_kw = dict( search_kw = dict(
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, mode=None, Movement_getMirrorSectionTitle=None, **kw</string> </value> <value> <string>select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, select_mode=None, Movement_getMirrorSectionTitle=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -13,7 +13,7 @@ context.activate(tag=tag).PaymentTransactionGroup_selectPaymentTransactionLineLi ...@@ -13,7 +13,7 @@ context.activate(tag=tag).PaymentTransactionGroup_selectPaymentTransactionLineLi
start_date_range_min=start_date_range_min, start_date_range_min=start_date_range_min,
start_date_range_max=start_date_range_max, start_date_range_max=start_date_range_max,
sign=sign, sign=sign,
mode=mode, select_mode=select_mode,
Movement_getMirrorSectionTitle=listbox_Movement_getMirrorSectionTitle, Movement_getMirrorSectionTitle=listbox_Movement_getMirrorSectionTitle,
tag=tag) tag=tag)
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>uids=(), form_id=\'view\', select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, mode=None, listbox_Movement_getMirrorSectionTitle=None, **kw</string> </value> <value> <string>uids=(), form_id=\'view\', select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, select_mode=None, listbox_Movement_getMirrorSectionTitle=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -16,13 +16,13 @@ else: ...@@ -16,13 +16,13 @@ else:
start_date_range_min=start_date_range_min, start_date_range_min=start_date_range_min,
start_date_range_max=start_date_range_max, start_date_range_max=start_date_range_max,
sign=sign, sign=sign,
mode=mode, select_mode=select_mode,
Movement_getMirrorSectionTitle=Movement_getMirrorSectionTitle,)] Movement_getMirrorSectionTitle=Movement_getMirrorSectionTitle,)]
if mode == 'stopped_or_delivered': if select_mode == 'stopped_or_delivered':
method_id = 'AccountingTransactionLine_addPaymentTransactionGroup' method_id = 'AccountingTransactionLine_addPaymentTransactionGroup'
else: else:
assert mode == 'planned_or_confirmed', "Unknown mode, %r" % mode assert select_mode == 'planned_or_confirmed', "Unknown select_mode, %r" % select_mode
method_id = 'AccountingTransactionLine_stopAndAddPaymentTransactionGroup' method_id = 'AccountingTransactionLine_stopAndAddPaymentTransactionGroup'
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>uids=(), select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, mode=None, Movement_getMirrorSectionTitle=None, tag=\'\'</string> </value> <value> <string>uids=(), select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, select_mode=None, Movement_getMirrorSectionTitle=None, tag=\'\'</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<string>your_start_date_range_min</string> <string>your_start_date_range_min</string>
<string>your_start_date_range_max</string> <string>your_start_date_range_max</string>
<string>your_sign</string> <string>your_sign</string>
<string>your_mode</string> <string>your_select_mode</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_mode</string> </value> <value> <string>your_select_mode</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -250,7 +250,7 @@ class TestPaymentTransactionGroupPaymentSelection(AccountingTestCase): ...@@ -250,7 +250,7 @@ class TestPaymentTransactionGroupPaymentSelection(AccountingTestCase):
start_date_range_min=None, start_date_range_min=None,
start_date_range_max=None, start_date_range_max=None,
sign='incoming', sign='incoming',
mode='stopped_or_delivered', select_mode='stopped_or_delivered',
) )
self.assertEqual( self.assertEqual(
sorted([line.getObject().getRelativeUrl() for line in line_list]), sorted([line.getObject().getRelativeUrl() for line in line_list]),
...@@ -265,7 +265,7 @@ class TestPaymentTransactionGroupPaymentSelection(AccountingTestCase): ...@@ -265,7 +265,7 @@ class TestPaymentTransactionGroupPaymentSelection(AccountingTestCase):
start_date_range_min=None, start_date_range_min=None,
start_date_range_max=None, start_date_range_max=None,
sign='incoming', sign='incoming',
mode='stopped_or_delivered', select_mode='stopped_or_delivered',
) )
self.assertEqual( self.assertEqual(
sorted([line.getObject().getRelativeUrl() for line in line_list]), sorted([line.getObject().getRelativeUrl() for line in line_list]),
...@@ -314,7 +314,7 @@ class TestPaymentTransactionGroupPaymentSelection(AccountingTestCase): ...@@ -314,7 +314,7 @@ class TestPaymentTransactionGroupPaymentSelection(AccountingTestCase):
price_currency_value=self.portal.currency_module.euro, price_currency_value=self.portal.currency_module.euro,
stop_date=DateTime(2014, 1, 31),) stop_date=DateTime(2014, 1, 31),)
self.tic() self.tic()
ptg.PaymentTransactionGroup_selectPaymentTransactionLineList(mode='stopped_or_delivered') ptg.PaymentTransactionGroup_selectPaymentTransactionLineList(select_mode='stopped_or_delivered')
self.tic() self.tic()
self.assertEqual( self.assertEqual(
payment.bank.getAggregateValueList(), payment.bank.getAggregateValueList(),
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
<td>field_your_sign</td> <td>field_your_sign</td>
<td>Outgoing</td> <td>Outgoing</td>
</tr> </tr>
<!-- there's an empty listbox by default (and not a "Invalid Search Criteria-Reset" error) -->
<tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block>
<!-- update dialog --> <!-- update dialog -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" />
......
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
<tr> <tr>
<td>assertSelected</td> <td>assertSelected</td>
<td>field_your_mode</td> <td>field_your_select_mode</td>
<td>Select already Posted to General Ledger or Closed Payments</td> <td>Select already Posted to General Ledger or Closed Payments</td>
</tr> </tr>
<!-- update dialog --> <!-- update dialog -->
<tr> <tr>
<td>select</td> <td>select</td>
<td>field_your_mode</td> <td>field_your_select_mode</td>
<td>Select Planned or Confirmed Payments and Post them to General Ledger</td> <td>Select Planned or Confirmed Payments and Post them to General Ledger</td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/update_dialog" />
......
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
<tr> <tr>
<td>assertSelected</td> <td>assertSelected</td>
<td>field_your_mode</td> <td>field_your_select_mode</td>
<td>Select already Posted to General Ledger or Closed Payments</td> <td>Select already Posted to General Ledger or Closed Payments</td>
</tr> </tr>
<!-- update dialog --> <!-- update dialog -->
<tr> <tr>
<td>select</td> <td>select</td>
<td>field_your_mode</td> <td>field_your_select_mode</td>
<td>Select Planned or Confirmed Payments and Post them to General Ledger</td> <td>Select Planned or Confirmed Payments and Post them to General Ledger</td>
</tr> </tr>
......
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