Commit 68658a02 authored by Fabien Morin's avatar Fabien Morin

- use contentValues instead of searchFolder in model listbox

- use Base_redirect instead of the old nosh
- use SQLQueue instead of implicit SQLDict which makes not possible to create
more than one Apparel Model Colour Variation. Now it's possible

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29227 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c8bb8d3a
...@@ -57,13 +57,8 @@ ...@@ -57,13 +57,8 @@
apparel_colour_range = context.getSpecialiseValue(portal_type=(\'Apparel Colour Range\',))\n apparel_colour_range = context.getSpecialiseValue(portal_type=(\'Apparel Colour Range\',))\n
\n \n
if apparel_colour_range is None:\n if apparel_colour_range is None:\n
redirect_url = \'%s/%s?%s\' % ( context.absolute_url()\n msg = \'No Apparel Colour Range defined.\'\n
, form_id\n
, \'portal_status_message=No+Apparel+Colour+Range+defined.\'\n
)\n
\n
else:\n else:\n
\n
apparel_colour_range_variation_list = map( lambda x: x.getObject(), apparel_colour_range.searchFolder(portal_type=(\'Apparel Colour Range Variation\',)))\n apparel_colour_range_variation_list = map( lambda x: x.getObject(), apparel_colour_range.searchFolder(portal_type=(\'Apparel Colour Range Variation\',)))\n
\n \n
apparel_model_colour_variation_list = context.searchFolder(portal_type=(\'Apparel Model Colour Variation\',))\n apparel_model_colour_variation_list = context.searchFolder(portal_type=(\'Apparel Model Colour Variation\',))\n
...@@ -75,26 +70,18 @@ else:\n ...@@ -75,26 +70,18 @@ else:\n
if apparel_colour_range_variation.getTitle() not in apparel_model_colour_variation_title_list:\n if apparel_colour_range_variation.getTitle() not in apparel_model_colour_variation_title_list:\n
count += 1\n count += 1\n
# Use portal activity for creating lot of variation\n # Use portal activity for creating lot of variation\n
context.activate().newContent(\n context.activate(activity=\'SQLQueue\').newContent(\n
type_name = \'Apparel Model Colour Variation\',\n portal_type = \'Apparel Model Colour Variation\',\n
title = apparel_colour_range_variation.getTitle(),\n title = apparel_colour_range_variation.getTitle(),\n
description = apparel_colour_range_variation.getDescription()\n description = apparel_colour_range_variation.getDescription()\n
)\n )\n
\n \n
if count != 0:\n if count != 0:\n
redirect_url = \'%s/%s?%s\' % ( context.absolute_url()\n msg = \'Creating %s Apparel Model Colour Variation.\' % count\n
, form_id\n
, \'portal_status_message=Creating+%s+Apparel+Model+Colour+Variation.\' % count\n
)\n
else:\n else:\n
msg = \'No new Apparel Colour Range Variation defined.\'\n
\n \n
redirect_url = \'%s/%s?%s\' % ( context.absolute_url()\n context.Base_redirect(keep_items=dict(portal_status_message=msg))\n
, form_id\n
, \'portal_status_message=No+new+Apparel+Colour+Range+Variation+defined.\'\n
)\n
\n
\n
request[ \'RESPONSE\' ].redirect( redirect_url )\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -137,7 +124,7 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n ...@@ -137,7 +124,7 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>request</string> <string>request</string>
<string>apparel_colour_range</string> <string>apparel_colour_range</string>
<string>None</string> <string>None</string>
<string>redirect_url</string> <string>msg</string>
<string>map</string> <string>map</string>
<string>apparel_colour_range_variation_list</string> <string>apparel_colour_range_variation_list</string>
<string>apparel_model_colour_variation_list</string> <string>apparel_model_colour_variation_list</string>
...@@ -146,7 +133,7 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n ...@@ -146,7 +133,7 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>_getiter_</string> <string>_getiter_</string>
<string>apparel_colour_range_variation</string> <string>apparel_colour_range_variation</string>
<string>_inplacevar_</string> <string>_inplacevar_</string>
<string>_getitem_</string> <string>dict</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="ListBox" module="Products.ERP5Form.ListBox"/>
<string>Products.ERP5Form.ListBox</string> <tuple/>
<string>ListBox</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -342,6 +339,10 @@ ...@@ -342,6 +339,10 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>anchor</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
...@@ -425,6 +426,10 @@ ...@@ -425,6 +426,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>10</int> </value> <value> <int>10</int> </value>
...@@ -445,6 +450,10 @@ ...@@ -445,6 +450,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <value>
...@@ -466,6 +475,10 @@ ...@@ -466,6 +475,10 @@
<key> <string>report_tree</string> </key> <key> <string>report_tree</string> </key>
<value> <int>0</int> </value> <value> <int>0</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>0</int> </value> <value> <int>0</int> </value>
...@@ -510,6 +523,12 @@ ...@@ -510,6 +523,12 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Colour Variations</string> </value> <value> <string>Colour Variations</string> </value>
</item> </item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
<value> <value>
...@@ -525,18 +544,15 @@ ...@@ -525,18 +544,15 @@
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="Method" module="Products.Formulator.MethodField"/>
<string>Products.Formulator.MethodField</string> <tuple/>
<string>Method</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <string>searchFolder</string> </value> <value> <string>contentValues</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
21 22
\ 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