Commit 2ba4a897 authored by Jérome Perrin's avatar Jérome Perrin Committed by Aurel

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 8b15a5f2
......@@ -17,8 +17,8 @@ search_kw = dict(
if context.getPaymentMode():
search_kw['payment_transaction_line_payment_mode_uid'] = context.getPaymentModeUid()
if limit:
search_kw['limit'] = limit
if select_limit:
search_kw['limit'] = select_limit
if start_date_range_max:
search_kw['at_date'] = start_date_range_max.latestTime()
......
......@@ -50,7 +50,7 @@
</item>
<item>
<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>
<key> <string>id</string> </key>
......
......@@ -8,7 +8,7 @@ if context.getPortalObject().portal_activities.countMessageWithTag(tag,):
"Some payments are still beeing processed in the background, please retry later")))
context.activate(tag=tag).PaymentTransactionGroup_selectPaymentTransactionLineListActive(
limit=limit,
select_limit=select_limit,
start_date_range_min=start_date_range_min,
start_date_range_max=start_date_range_max,
sign=sign,
......
......@@ -50,7 +50,7 @@
</item>
<item>
<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>
<key> <string>id</string> </key>
......
......@@ -7,7 +7,7 @@ aggregate = context.getRelativeUrl()
payment_relative_url_list = [brain.relative_url for brain
in context.PaymentTransactionGroup_getGroupablePaymentTransactionLineList(
limit=limit,
select_limit=select_limit,
start_date_range_min=start_date_range_min,
start_date_range_max=start_date_range_max,
sign=sign,)]
......
......@@ -50,7 +50,7 @@
</item>
<item>
<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>
<key> <string>_proxy_roles</string> </key>
......
......@@ -98,7 +98,7 @@
<key> <string>left</string> </key>
<value>
<list>
<string>your_limit</string>
<string>your_select_limit</string>
<string>your_start_date_range_min</string>
<string>your_start_date_range_max</string>
<string>your_sign</string>
......
......@@ -10,6 +10,9 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>end</string>
<string>required</string>
<string>start</string>
<string>title</string>
</list>
......@@ -17,7 +20,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_limit</string> </value>
<value> <string>your_select_limit</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -61,10 +64,18 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -72,6 +83,14 @@
<key> <string>values</string> </key>
<value>
<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>
<key> <string>field_id</string> </key>
<value> <string>my_integer_value</string> </value>
......@@ -80,6 +99,10 @@
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>start</string> </key>
<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