Commit e67c3203 authored by Jérome Perrin's avatar Jérome Perrin

supports searching and sorting by account reference

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30285 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2774b28b
...@@ -58,13 +58,26 @@ params = context.ERP5Accounting_getParams(selection_name)\n ...@@ -58,13 +58,26 @@ params = context.ERP5Accounting_getParams(selection_name)\n
if params.get(\'precision\', None) is not None:\n if params.get(\'precision\', None) is not None:\n
context.REQUEST.set(\'precision\', params[\'precision\'])\n context.REQUEST.set(\'precision\', params[\'precision\'])\n
\n \n
use_account_reference = \\\n
context.portal_preferences.getPreferredAccountNumberMethod() == \'account_reference\'\n
\n
if preferred_gap_id:\n
if use_account_reference:\n
kwd[\'reference\'] = preferred_gap_id\n
else:\n
kwd[\'preferred_gap_id\'] = preferred_gap_id\n
\n
\n
# XXX workaround for #458, we rewrite sort_on id to sort_on using\n # XXX workaround for #458, we rewrite sort_on id to sort_on using\n
# strict_membership.\n # strict_membership.\n
new_sort_on = []\n new_sort_on = []\n
if sort_on is not None:\n if sort_on is not None:\n
for sort_on_item in sort_on:\n for sort_on_item in sort_on:\n
if sort_on_item[0] == \'preferred_gap_id\':\n if sort_on_item[0] == \'preferred_gap_id\':\n
new_sort_on.append(\n if use_account_reference:\n
new_sort_on.append((\'reference\', sort_on_item[1]))\n
else:\n
new_sort_on.append(\n
(\'preferred_gap_strict_membership_id\', sort_on_item[1]))\n (\'preferred_gap_strict_membership_id\', sort_on_item[1]))\n
else:\n else:\n
new_sort_on.append(sort_on_item)\n new_sort_on.append(sort_on_item)\n
...@@ -80,7 +93,7 @@ return context.portal_catalog(sort_on=new_sort_on, **kwd)\n ...@@ -80,7 +93,7 @@ return context.portal_catalog(sort_on=new_sort_on, **kwd)\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>sort_on=None, selection=None, selection_name=None, **kwd</string> </value> <value> <string>preferred_gap_id=None, sort_on=None, selection=None, selection_name=None, **kwd</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -100,12 +113,13 @@ return context.portal_catalog(sort_on=new_sort_on, **kwd)\n ...@@ -100,12 +113,13 @@ return context.portal_catalog(sort_on=new_sort_on, **kwd)\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>3</int> </value> <value> <int>4</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>preferred_gap_id</string>
<string>sort_on</string> <string>sort_on</string>
<string>selection</string> <string>selection</string>
<string>selection_name</string> <string>selection_name</string>
...@@ -115,6 +129,8 @@ return context.portal_catalog(sort_on=new_sort_on, **kwd)\n ...@@ -115,6 +129,8 @@ return context.portal_catalog(sort_on=new_sort_on, **kwd)\n
<string>params</string> <string>params</string>
<string>None</string> <string>None</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>use_account_reference</string>
<string>_write_</string>
<string>new_sort_on</string> <string>new_sort_on</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>sort_on_item</string> <string>sort_on_item</string>
...@@ -134,6 +150,7 @@ return context.portal_catalog(sort_on=new_sort_on, **kwd)\n ...@@ -134,6 +150,7 @@ return context.portal_catalog(sort_on=new_sort_on, **kwd)\n
<none/> <none/>
<none/> <none/>
<none/> <none/>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -416,9 +416,7 @@ ...@@ -416,9 +416,7 @@
</item> </item>
<item> <item>
<key> <string>count_method</string> </key> <key> <string>count_method</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
...@@ -506,6 +504,10 @@ ...@@ -506,6 +504,10 @@
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <int>15</int> </value> <value> <int>15</int> </value>
...@@ -517,7 +519,7 @@ ...@@ -517,7 +519,7 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -564,6 +566,10 @@ ...@@ -564,6 +566,10 @@
<key> <string>report_tree</string> </key> <key> <string>report_tree</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item>
<key> <string>row_css_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>search</string> </key> <key> <string>search</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
...@@ -657,7 +663,7 @@ ...@@ -657,7 +663,7 @@
<item> <item>
<key> <string>stat_method</string> </key> <key> <string>stat_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -700,22 +706,6 @@ ...@@ -700,22 +706,6 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>portal_catalog</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
...@@ -731,7 +721,7 @@ ...@@ -731,7 +721,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
......
1030 1031
\ No newline at end of file \ No newline at end of file
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