Commit 2aaf462e authored by Jérome Perrin's avatar Jérome Perrin

payment_mean: rework "limit" on select payment dialog

Rename the field, because on xhtml_style, submitting the field with an
empty limit now cause an error like:

    ValueError: invalid literal for int() with base 10: ''

and on ERP5JS it is ignoed.

Also, make the field required and set a small default value and a range,
to prevent accidentally displaying/selecting too much when there's lot of
data matching.
parent 137dcffb
...@@ -17,8 +17,8 @@ search_kw = dict( ...@@ -17,8 +17,8 @@ search_kw = dict(
if context.getPaymentMode(): if context.getPaymentMode():
search_kw['payment_transaction_line_payment_mode_uid'] = context.getPaymentModeUid() search_kw['payment_transaction_line_payment_mode_uid'] = context.getPaymentModeUid()
if limit: if select_limit:
search_kw['limit'] = limit search_kw['limit'] = select_limit
if start_date_range_max: if start_date_range_max:
search_kw['at_date'] = start_date_range_max.latestTime() search_kw['at_date'] = start_date_range_max.latestTime()
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, **kw</string> </value> <value> <string>select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -8,7 +8,7 @@ if context.getPortalObject().portal_activities.countMessageWithTag(tag,): ...@@ -8,7 +8,7 @@ if context.getPortalObject().portal_activities.countMessageWithTag(tag,):
"Some payments are still beeing processed in the background, please retry later"))) "Some payments are still beeing processed in the background, please retry later")))
context.activate(tag=tag).PaymentTransactionGroup_selectPaymentTransactionLineListActive( context.activate(tag=tag).PaymentTransactionGroup_selectPaymentTransactionLineListActive(
limit=limit, select_limit=select_limit,
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,
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>form_id=\'view\', limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, **kw</string> </value> <value> <string>form_id=\'view\', select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -7,7 +7,7 @@ aggregate = context.getRelativeUrl() ...@@ -7,7 +7,7 @@ aggregate = context.getRelativeUrl()
payment_relative_url_list = [brain.relative_url for brain payment_relative_url_list = [brain.relative_url for brain
in context.PaymentTransactionGroup_getGroupablePaymentTransactionLineList( in context.PaymentTransactionGroup_getGroupablePaymentTransactionLineList(
limit=limit, select_limit=select_limit,
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,)]
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, tag=\'\'</string> </value> <value> <string>select_limit=None, start_date_range_min=None, start_date_range_max=None, sign=None, tag=\'\'</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list>
<string>your_limit</string> <string>your_select_limit</string>
<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>
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>end</string>
<string>required</string>
<string>start</string> <string>start</string>
<string>title</string> <string>title</string>
</list> </list>
...@@ -17,7 +20,7 @@ ...@@ -17,7 +20,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_limit</string> </value> <value> <string>your_select_limit</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -61,10 +64,18 @@ ...@@ -61,10 +64,18 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -72,6 +83,14 @@ ...@@ -72,6 +83,14 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string>50</string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <int>1000</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_integer_value</string> </value> <value> <string>my_integer_value</string> </value>
...@@ -80,6 +99,10 @@ ...@@ -80,6 +99,10 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>start</string> </key> <key> <string>start</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
......
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