Commit 6a962b0b authored by Jérome Perrin's avatar Jérome Perrin

Modify grouping fast input to start in grouping mode by default, and replace...

Modify grouping fast input to start in grouping mode by default, and replace the check box by a combo box, it's more intuitive

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19882 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 88264ea7
...@@ -72,11 +72,8 @@ stool = portal.portal_simulation\n ...@@ -72,11 +72,8 @@ stool = portal.portal_simulation\n
\n \n
# we use a different selection for dialog params, because we never want this\n # we use a different selection for dialog params, because we never want this\n
# selection to be reseteted\n # selection to be reseteted\n
dialog_params_selection = portal.portal_selections.getSelectionFor(\n dialog_selection_params = portal.portal_selections.getSelectionParamsFor(\n
\'grouping_reference_fast_input_selection\')\n \'grouping_reference_fast_input_selection\')\n
selection_params = {}\n
if dialog_params_selection is not None:\n
selection_params = dialog_params_selection.getParams()\n
\n \n
# support pseudo sorting; sorting is done by uid.\n # support pseudo sorting; sorting is done by uid.\n
orig_sort_on = portal.portal_selections.getSelectionSortOrder(\n orig_sort_on = portal.portal_selections.getSelectionSortOrder(\n
...@@ -92,11 +89,10 @@ extra_query_keys = {}\n ...@@ -92,11 +89,10 @@ extra_query_keys = {}\n
section_uid = portal.Base_getSectionUidListForSectionCategory(\n section_uid = portal.Base_getSectionUidListForSectionCategory(\n
portal.portal_preferences.getPreferredAccountingTransactionSectionCategory())\n portal.portal_preferences.getPreferredAccountingTransactionSectionCategory())\n
\n \n
# unconditionnaly get from dialog selection\n grouping = dialog_selection_params.get(\'grouping\', \'grouping\')\n
grouping = selection_params.get(\'grouping\')\n
\n \n
search_kw = dict()\n search_kw = dict()\n
node = node or request.get(\'node\') or selection_params.get(\'node\')\n node = node or request.get(\'node\') or dialog_selection_params.get(\'node\')\n
if node:\n if node:\n
search_kw[\'node_uid\'] = portal.restrictedTraverse(node).getUid()\n search_kw[\'node_uid\'] = portal.restrictedTraverse(node).getUid()\n
mirror_section = mirror_section or request.get(\'mirror_section\')\n mirror_section = mirror_section or request.get(\'mirror_section\')\n
...@@ -104,9 +100,10 @@ if mirror_section:\n ...@@ -104,9 +100,10 @@ if mirror_section:\n
search_kw[\'mirror_section_uid\'] = portal.restrictedTraverse(\n search_kw[\'mirror_section_uid\'] = portal.restrictedTraverse(\n
mirror_section).getUid()\n mirror_section).getUid()\n
\n \n
if grouping:\n if grouping == \'grouping\':\n
where_expression = \'catalog.grouping_reference is NULL\'\n where_expression = \'catalog.grouping_reference is NULL\'\n
else:\n else:\n
assert grouping == \'ungrouping\', grouping\n
where_expression = \'catalog.grouping_reference is not NULL\'\n where_expression = \'catalog.grouping_reference is not NULL\'\n
\n \n
return stool.getMovementHistoryList(\n return stool.getMovementHistoryList(\n
...@@ -137,7 +134,7 @@ return stool.getMovementHistoryList(\n ...@@ -137,7 +134,7 @@ return stool.getMovementHistoryList(\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>selection=None, grouping=0, node=\'\', mirror_section=\'\', **kw</string> </value> <value> <string>selection=None, grouping=\'grouping\', node=\'\', mirror_section=\'\', **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -175,9 +172,7 @@ return stool.getMovementHistoryList(\n ...@@ -175,9 +172,7 @@ return stool.getMovementHistoryList(\n
<string>portal</string> <string>portal</string>
<string>ctool</string> <string>ctool</string>
<string>stool</string> <string>stool</string>
<string>dialog_params_selection</string> <string>dialog_selection_params</string>
<string>selection_params</string>
<string>None</string>
<string>orig_sort_on</string> <string>orig_sort_on</string>
<string>sort_on</string> <string>sort_on</string>
<string>_getiter_</string> <string>_getiter_</string>
...@@ -190,6 +185,7 @@ return stool.getMovementHistoryList(\n ...@@ -190,6 +185,7 @@ return stool.getMovementHistoryList(\n
<string>search_kw</string> <string>search_kw</string>
<string>_write_</string> <string>_write_</string>
<string>where_expression</string> <string>where_expression</string>
<string>AssertionError</string>
<string>_apply_</string> <string>_apply_</string>
</tuple> </tuple>
</value> </value>
...@@ -204,7 +200,7 @@ return stool.getMovementHistoryList(\n ...@@ -204,7 +200,7 @@ return stool.getMovementHistoryList(\n
<value> <value>
<tuple> <tuple>
<none/> <none/>
<int>0</int> <string>grouping</string>
<string></string> <string></string>
<string></string> <string></string>
</tuple> </tuple>
......
...@@ -75,7 +75,8 @@ getobject = portal.portal_catalog.getobject\n ...@@ -75,7 +75,8 @@ getobject = portal.portal_catalog.getobject\n
N_ = portal.Base_translateString\n N_ = portal.Base_translateString\n
psm = N_(\'Nothing matches\')\n psm = N_(\'Nothing matches\')\n
reset = 0\n reset = 0\n
precision = context.REQUEST.get(\'precision\', 2)\n request = container.REQUEST\n
precision = request.get(\'precision\', 2)\n
\n \n
# XXX when should it be validated ?\n # XXX when should it be validated ?\n
if node == \'\':\n if node == \'\':\n
...@@ -84,7 +85,9 @@ if mirror_section == \'\':\n ...@@ -84,7 +85,9 @@ if mirror_section == \'\':\n
mirror_section = context.REQUEST.get(\'field_your_mirror_section\',\n mirror_section = context.REQUEST.get(\'field_your_mirror_section\',\n
mirror_section)\n mirror_section)\n
if grouping == \'\':\n if grouping == \'\':\n
grouping = context.REQUEST.get(\'field_your_grouping\', grouping)\n grouping = request.get(\'your_grouping\',\n
request.get(\'field_your_grouping\',\n
grouping))\n
\n \n
# edit selection for dialog parameters\n # edit selection for dialog parameters\n
portal.portal_selections.setSelectionParamsFor(\n portal.portal_selections.setSelectionParamsFor(\n
...@@ -102,6 +105,7 @@ if uids:\n ...@@ -102,6 +105,7 @@ if uids:\n
total_selected_amount += (line.getSourceInventoriatedTotalAssetPrice() or 0)\n total_selected_amount += (line.getSourceInventoriatedTotalAssetPrice() or 0)\n
else:\n else:\n
total_selected_amount += (line.getDestinationInventoriatedTotalAssetPrice() or 0)\n total_selected_amount += (line.getDestinationInventoriatedTotalAssetPrice() or 0)\n
request.set(\'total_selected_amount\', total_selected_amount)\n
\n \n
if update:\n if update:\n
# update selected uids \n # update selected uids \n
...@@ -109,19 +113,12 @@ if update:\n ...@@ -109,19 +113,12 @@ if update:\n
selection_name, uids=uids, listbox_uid=listbox_uid,\n selection_name, uids=uids, listbox_uid=listbox_uid,\n
REQUEST=context.REQUEST)\n REQUEST=context.REQUEST)\n
\n \n
psm = N_(\'Updated\')\n request.set(\'portal_status_message\', N_(\'Updated\'))\n
return context.REQUEST.RESPONSE.redirect(\n return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\n
\'%s/AccountingTransactionModule_viewGroupingFastInputDialog?%s\' % (\n \n
context.absolute_url(),\n
make_query(dict(node=node,\n
grouping=grouping,\n
mirror_section=mirror_section,\n
cancel_url=cancel_url,\n
total_selected_amount=total_selected_amount,\n
portal_status_message=psm))))\n
\n \n
# otherwise, try to group...\n # otherwise, try to group...\n
if grouping:\n if grouping == \'grouping\':\n
grouped_line_list = context.AccountingTransaction_guessGroupedLines(\n grouped_line_list = context.AccountingTransaction_guessGroupedLines(\n
accounting_transaction_line_uid_list=uids)\n accounting_transaction_line_uid_list=uids)\n
if grouped_line_list:\n if grouped_line_list:\n
...@@ -166,6 +163,7 @@ if grouping:\n ...@@ -166,6 +163,7 @@ if grouping:\n
# Workflow action not supported\n # Workflow action not supported\n
pass\n pass\n
else:\n else:\n
assert grouping == \'ungrouping\'\n
# or to ungroup based on how we are called.\n # or to ungroup based on how we are called.\n
amount_per_node_mirror_section = dict()\n amount_per_node_mirror_section = dict()\n
# XXX is uids multi page safe here ?\n # XXX is uids multi page safe here ?\n
...@@ -202,16 +200,8 @@ else:\n ...@@ -202,16 +200,8 @@ else:\n
else:\n else:\n
psm = N_(\'Ungrouping refused. Check your selection\')\n psm = N_(\'Ungrouping refused. Check your selection\')\n
\n \n
context.REQUEST.RESPONSE.redirect(\n request.set(\'portal_status_message\', psm)\n
\'%s/AccountingTransactionModule_viewGroupingFastInputDialog?%s\' % (\n return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\n
context.absolute_url(),\n
make_query(dict(node=node,\n
grouping=grouping,\n
mirror_section=mirror_section,\n
cancel_url=cancel_url,\n
total_selected_amount=total_selected_amount,\n
reset=reset,\n
portal_status_message=psm))))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -234,7 +224,7 @@ context.REQUEST.RESPONSE.redirect(\n ...@@ -234,7 +224,7 @@ context.REQUEST.RESPONSE.redirect(\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>uids=[], listbox=None, listbox_uid=[], selection_name=\'\', grouping=\'\', node=\'\', mirror_section=\'\', cancel_url=\'\', update=0, **kw</string> </value> <value> <string>uids=[], listbox=None, listbox_uid=[], selection_name=\'\', grouping=\'\', node=\'\', mirror_section=\'\', update=0, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -254,7 +244,7 @@ context.REQUEST.RESPONSE.redirect(\n ...@@ -254,7 +244,7 @@ context.REQUEST.RESPONSE.redirect(\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>9</int> </value> <value> <int>8</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -267,7 +257,6 @@ context.REQUEST.RESPONSE.redirect(\n ...@@ -267,7 +257,6 @@ context.REQUEST.RESPONSE.redirect(\n
<string>grouping</string> <string>grouping</string>
<string>node</string> <string>node</string>
<string>mirror_section</string> <string>mirror_section</string>
<string>cancel_url</string>
<string>update</string> <string>update</string>
<string>kw</string> <string>kw</string>
<string>ZTUtils</string> <string>ZTUtils</string>
...@@ -281,6 +270,8 @@ context.REQUEST.RESPONSE.redirect(\n ...@@ -281,6 +270,8 @@ context.REQUEST.RESPONSE.redirect(\n
<string>N_</string> <string>N_</string>
<string>psm</string> <string>psm</string>
<string>reset</string> <string>reset</string>
<string>container</string>
<string>request</string>
<string>precision</string> <string>precision</string>
<string>dict</string> <string>dict</string>
<string>total_selected_amount</string> <string>total_selected_amount</string>
...@@ -298,6 +289,7 @@ context.REQUEST.RESPONSE.redirect(\n ...@@ -298,6 +289,7 @@ context.REQUEST.RESPONSE.redirect(\n
<string>cleared</string> <string>cleared</string>
<string>account</string> <string>account</string>
<string>date</string> <string>date</string>
<string>AssertionError</string>
<string>amount_per_node_mirror_section</string> <string>amount_per_node_mirror_section</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
...@@ -329,7 +321,6 @@ context.REQUEST.RESPONSE.redirect(\n ...@@ -329,7 +321,6 @@ context.REQUEST.RESPONSE.redirect(\n
<string></string> <string></string>
<string></string> <string></string>
<string></string> <string></string>
<string></string>
<int>0</int> <int>0</int>
</tuple> </tuple>
</value> </value>
......
...@@ -76,8 +76,7 @@ return context.AccountingTransactionModule_setGroupingReference(\n ...@@ -76,8 +76,7 @@ return context.AccountingTransactionModule_setGroupingReference(\n
selection_name=list_selection_name,\n selection_name=list_selection_name,\n
node=node,\n node=node,\n
mirror_section=mirror_section,\n mirror_section=mirror_section,\n
update=1,\n update=1)\n
cancel_url=cancel_url)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -3,12 +3,18 @@ ...@@ -3,12 +3,18 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<global name="CheckBoxField" module="Products.Formulator.StandardFields"/> <global name="RadioField" module="Products.Formulator.StandardFields"/>
<tuple/> <tuple/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_grouping</string> </value> <value> <string>your_grouping</string> </value>
...@@ -21,6 +27,14 @@ ...@@ -21,6 +27,14 @@
<key> <string>external_validator_failed</string> </key> <key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value> <value> <string>The input failed the external validator.</string> </value>
</item> </item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>unknown_selection</string> </key>
<value> <string>You selected an item that was not in the list.</string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -57,17 +71,41 @@ ...@@ -57,17 +71,41 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>orientation</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -106,17 +144,43 @@ ...@@ -106,17 +144,43 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>orientation</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -134,7 +198,7 @@ ...@@ -134,7 +198,7 @@
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <int>0</int> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -153,16 +217,42 @@ ...@@ -153,16 +217,42 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra_item</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>first_item</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<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>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>orientation</string> </key>
<value> <string>vertical</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Grouping (or ungroupping)</string> </value> <value> <string>Mode</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
...@@ -181,7 +271,23 @@ ...@@ -181,7 +271,23 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>request/grouping | python:here.portal_selections.getSelectionParamsFor(\'grouping_reference_fast_input_selection\').get(\'grouping\', 0)</string> </value> <value> <string>request/grouping | python:here.portal_selections.getSelectionParamsFor(\'grouping_reference_fast_input_selection\').get(\'grouping\', \'grouping\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(context.Base_translateString(\'Grouping\'), \'grouping\'), (context.Base_translateString(\'Ungrouping\'), \'ungrouping\'),]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
639 640
\ 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