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