Commit 1b04f949 authored by Sebastien Robin's avatar Sebastien Robin

- add more conditions when displaying reports

- check the "add portal content" permission when saving fast
input, this prevent security issues
- set the reference of the counter date in the
workflow instead of the init script
- delete all checks when we delete the checkboook

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19225 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 50b2e324
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<key> <string>permissions</string> </key> <key> <string>permissions</string> </key>
<value> <value>
<tuple> <tuple>
<string>Modify portal content</string> <string>Manage portal</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -80,4 +82,24 @@ ...@@ -80,4 +82,24 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python: len([x for x in object.Baobab_getFunctionList([\'counter\']) if x in object.Baobab_getUserAssignedFunctionList()])>0
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -80,4 +82,24 @@ ...@@ -80,4 +82,24 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python: len([x for x in object.Baobab_getFunctionList([\'counter\']) if x in object.Baobab_getUserAssignedFunctionList()])>0
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -67,6 +67,12 @@ ...@@ -67,6 +67,12 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
from AccessControl import getSecurityManager\n
u=getSecurityManager().getUser()\n
ADD_PERMISSION = \'Add portal content\'\n
if not u.has_permission(ADD_PERMISSION,context):\n
raise ValueError, "How did you manage to be there ???"\n
\n
cell_base_id = \'movement\'\n cell_base_id = \'movement\'\n
line_kwd = {\'base_id\':cell_base_id}\n line_kwd = {\'base_id\':cell_base_id}\n
\n \n
...@@ -379,6 +385,13 @@ else:\n ...@@ -379,6 +385,13 @@ else:\n
<string>listbox</string> <string>listbox</string>
<string>form_id</string> <string>form_id</string>
<string>kw</string> <string>kw</string>
<string>AccessControl</string>
<string>getSecurityManager</string>
<string>_getattr_</string>
<string>u</string>
<string>ADD_PERMISSION</string>
<string>context</string>
<string>ValueError</string>
<string>cell_base_id</string> <string>cell_base_id</string>
<string>line_kwd</string> <string>line_kwd</string>
<string>_getitem_</string> <string>_getitem_</string>
...@@ -400,8 +413,6 @@ else:\n ...@@ -400,8 +413,6 @@ else:\n
<string>error</string> <string>error</string>
<string>negative_quantity</string> <string>negative_quantity</string>
<string>float_quantity</string> <string>float_quantity</string>
<string>_getattr_</string>
<string>context</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
<string>_getiter_</string> <string>_getiter_</string>
......
...@@ -52,6 +52,10 @@ ...@@ -52,6 +52,10 @@
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>Base_edit</string> </value> <value> <string>Base_edit</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value> <string>None</string> </value>
</item>
<item> <item>
<key> <string>encoding</string> </key> <key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value> <value> <string>UTF-8</string> </value>
...@@ -88,6 +92,7 @@ ...@@ -88,6 +92,7 @@
<key> <string>center</string> </key> <key> <string>center</string> </key>
<value> <value>
<list> <list>
<string>my_translated_validation_state_title</string>
<string>my_description</string> <string>my_description</string>
</list> </list>
</value> </value>
......
...@@ -38,10 +38,6 @@ ...@@ -38,10 +38,6 @@
<key> <string>all_columns</string> </key> <key> <string>all_columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>all_editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -51,11 +47,11 @@ ...@@ -51,11 +47,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>count_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -114,6 +110,10 @@ ...@@ -114,6 +110,10 @@
<key> <string>meta_types</string> </key> <key> <string>meta_types</string> </key>
<value> <string></string> </value> <value> <string></string> </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> <string></string> </value> <value> <string></string> </value>
...@@ -177,10 +177,6 @@ ...@@ -177,10 +177,6 @@
<key> <string>all_columns</string> </key> <key> <string>all_columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>all_editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -190,11 +186,11 @@ ...@@ -190,11 +186,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>count_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -253,6 +249,10 @@ ...@@ -253,6 +249,10 @@
<key> <string>meta_types</string> </key> <key> <string>meta_types</string> </key>
<value> <string></string> </value> <value> <string></string> </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> <string></string> </value> <value> <string></string> </value>
...@@ -536,7 +536,7 @@ ...@@ -536,7 +536,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <string>searchFolder</string> </value> <value> <unicode>searchFolder</unicode> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -27,6 +27,22 @@ ...@@ -27,6 +27,22 @@
<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>line_too_long</string> </key>
<value> <string>A line was too long.</string> </value>
</item>
<item>
<key> <string>relation_result_ambiguous</string> </key>
<value> <string>Select appropriate document in the list.</string> </value>
</item>
<item>
<key> <string>relation_result_empty</string> </key>
<value> <string>No such document was found.</string> </value>
</item>
<item>
<key> <string>relation_result_too_long</string> </key>
<value> <string>Too many documents were found.</string> </value>
</item>
<item> <item>
<key> <string>required_not_found</string> </key> <key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value> <value> <string>Input is required but no input given.</string> </value>
...@@ -35,6 +51,10 @@ ...@@ -35,6 +51,10 @@
<key> <string>too_long</string> </key> <key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value> <value> <string>Too much input was given.</string> </value>
</item> </item>
<item>
<key> <string>too_many_lines</string> </key>
<value> <string>You entered too many lines.</string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -42,6 +62,14 @@ ...@@ -42,6 +62,14 @@
<key> <string>overrides</string> </key> <key> <string>overrides</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>allow_creation</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>allow_jump</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -55,15 +83,19 @@ ...@@ -55,15 +83,19 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>container_getter_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>default_module</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -94,18 +126,46 @@ ...@@ -94,18 +126,46 @@
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</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> <item>
<key> <string>jump_method</string> </key> <key> <string>jump_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>parameter_list</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -118,6 +178,14 @@ ...@@ -118,6 +178,14 @@
<key> <string>required</string> </key> <key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort</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>
...@@ -183,10 +251,6 @@ ...@@ -183,10 +251,6 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>default_module</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
......
...@@ -273,11 +273,8 @@ ...@@ -273,11 +273,8 @@
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<string>Products.Formulator.TALESField</string> <tuple/>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
......
...@@ -78,6 +78,10 @@ ...@@ -78,6 +78,10 @@
<key> <string>extra_item</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> <string></string> </value>
</item>
<item> <item>
<key> <string>hash_script_id</string> </key> <key> <string>hash_script_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -153,6 +157,10 @@ ...@@ -153,6 +157,10 @@
<key> <string>extra_item</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> <string></string> </value>
</item>
<item> <item>
<key> <string>hash_script_id</string> </key> <key> <string>hash_script_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -232,6 +240,10 @@ ...@@ -232,6 +240,10 @@
<key> <string>extra_item</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>hash_script_id</string> </key> <key> <string>hash_script_id</string> </key>
<value> <string>Checkbook_hashVariationCategoryItemList</string> </value> <value> <string>Checkbook_hashVariationCategoryItemList</string> </value>
...@@ -264,11 +276,7 @@ ...@@ -264,11 +276,7 @@
</item> </item>
<item> <item>
<key> <string>view_separator</string> </key> <key> <string>view_separator</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string></string> </value>
<br />
]]></string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
...@@ -279,11 +287,8 @@ ...@@ -279,11 +287,8 @@
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<string>Products.Formulator.TALESField</string> <tuple/>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
......
...@@ -52,6 +52,10 @@ ...@@ -52,6 +52,10 @@
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value> <string>None</string> </value>
</item>
<item> <item>
<key> <string>encoding</string> </key> <key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value> <value> <string>UTF-8</string> </value>
......
...@@ -38,10 +38,6 @@ ...@@ -38,10 +38,6 @@
<key> <string>all_columns</string> </key> <key> <string>all_columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>all_editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -58,10 +54,6 @@ ...@@ -58,10 +54,6 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -118,6 +110,10 @@ ...@@ -118,6 +110,10 @@
<key> <string>meta_types</string> </key> <key> <string>meta_types</string> </key>
<value> <string></string> </value> <value> <string></string> </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> <string></string> </value> <value> <string></string> </value>
...@@ -181,10 +177,6 @@ ...@@ -181,10 +177,6 @@
<key> <string>all_columns</string> </key> <key> <string>all_columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>all_editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -201,10 +193,6 @@ ...@@ -201,10 +193,6 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -261,6 +249,10 @@ ...@@ -261,6 +249,10 @@
<key> <string>meta_types</string> </key> <key> <string>meta_types</string> </key>
<value> <string></string> </value> <value> <string></string> </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> <string></string> </value> <value> <string></string> </value>
...@@ -348,6 +340,10 @@ ...@@ -348,6 +340,10 @@
<string>site_title</string> <string>site_title</string>
<string>Site</string> <string>Site</string>
</tuple> </tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple> <tuple>
<string>translated_simulation_state_title</string> <string>translated_simulation_state_title</string>
<string>State</string> <string>State</string>
...@@ -481,6 +477,10 @@ ...@@ -481,6 +477,10 @@
<string>site_title</string> <string>site_title</string>
<string>Site</string> <string>Site</string>
</tuple> </tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple> <tuple>
<string>translated_simulation_state_title</string> <string>translated_simulation_state_title</string>
<string>State</string> <string>State</string>
...@@ -514,6 +514,10 @@ ...@@ -514,6 +514,10 @@
<string>site_title</string> <string>site_title</string>
<string>Site</string> <string>Site</string>
</tuple> </tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple> <tuple>
<string>translated_simulation_state_title</string> <string>translated_simulation_state_title</string>
<string>State</string> <string>State</string>
...@@ -558,7 +562,7 @@ ...@@ -558,7 +562,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <string>searchFolder</string> </value> <value> <unicode>searchFolder</unicode> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -65,9 +65,7 @@ ...@@ -65,9 +65,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>from DateTime import DateTime\n
from DateTime import DateTime\n
\n \n
user_site_list = context.Baobab_getUserAssignedSiteList()\n user_site_list = context.Baobab_getUserAssignedSiteList()\n
if len(user_site_list) == 0:\n if len(user_site_list) == 0:\n
...@@ -77,24 +75,9 @@ site = context.Baobab_getVaultSite(user_site_list[0])\n ...@@ -77,24 +75,9 @@ site = context.Baobab_getVaultSite(user_site_list[0])\n
context.setSiteValue(site)\n context.setSiteValue(site)\n
context.setStartDate(DateTime(DateTime().Date()))\n context.setStartDate(DateTime(DateTime().Date()))\n
\n \n
# Set a reference\n \n
counter_date_list = [x.getObject() for x in context.portal_catalog(\n
portal_type=\'Counter Date\',site_id=site.getSiteId(),\n
sort_on=[(\'start_date\',\'descending\')],limit=1,\n
simulation_state=(\'open\',\'closed\'))]\n
previous_reference = None\n
if len(counter_date_list)>0:\n
previous_counter_date = counter_date_list[0]\n
previous_reference = previous_counter_date.getReference()\n
if previous_reference not in (\'\',None):\n
reference = \'%i\' % (int(previous_reference)+1)\n
else:\n
reference = \'1\'\n
context.setReference(reference)\n
context.assignRoleToSecurityGroup()\n context.assignRoleToSecurityGroup()\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -151,16 +134,6 @@ context.assignRoleToSecurityGroup()\n ...@@ -151,16 +134,6 @@ context.assignRoleToSecurityGroup()\n
<string>ValueError</string> <string>ValueError</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>site</string> <string>site</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>counter_date_list</string>
<string>None</string>
<string>previous_reference</string>
<string>previous_counter_date</string>
<string>int</string>
<string>reference</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -52,6 +52,10 @@ ...@@ -52,6 +52,10 @@
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>Base_edit</string> </value> <value> <string>Base_edit</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value> <string>None</string> </value>
</item>
<item> <item>
<key> <string>encoding</string> </key> <key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value> <value> <string>UTF-8</string> </value>
...@@ -99,6 +103,7 @@ ...@@ -99,6 +103,7 @@
<value> <value>
<list> <list>
<string>my_site</string> <string>my_site</string>
<string>my_reference</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
<item> <item>
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple/> <tuple>
<string>delete</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<string>archive_action</string> <string>archive_action</string>
<string>cancel</string> <string>cancel</string>
<string>cancel_action</string> <string>cancel_action</string>
<string>delete</string>
<string>deliver</string> <string>deliver</string>
<string>deliver_action</string> <string>deliver_action</string>
<string>stop</string> <string>stop</string>
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
<string>confirm</string> <string>confirm</string>
<string>confirm_action</string> <string>confirm_action</string>
<string>delete</string> <string>delete</string>
<string>delete_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>checkbook = state_change[\'object\']\n
\n
for check in checkbook.objectValues():\n
check.delete()\n
if check.getSimulationState() != \'deleted\':\n
msg = Message(domain="ui", message="Sorry, no way to delete this check $id",\n
mapping = {\'id\' : check.getId()})\n
raise ValueError, (msg,)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>kw</string>
<string>_getitem_</string>
<string>checkbook</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>check</string>
<string>Message</string>
<string>msg</string>
<string>ValueError</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Checkbook_deleteAllCheckList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
<value> <value>
<tuple> <tuple>
<string>confirm</string> <string>confirm</string>
<string>delete</string>
<string>delete_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
<value> <string></string> </value> <value> <string>Checkbook_deleteAllCheckList</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n <value> <string encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
counter_date = state_change[\'object\']\n counter_date = state_change[\'object\']\n
\n \n
...@@ -99,7 +101,29 @@ if listbox is not None:\n ...@@ -99,7 +101,29 @@ if listbox is not None:\n
if line["choice"] == "open":\n if line["choice"] == "open":\n
counter = context.restrictedTraverse("%s" %(line[\'listbox_key\'],))\n counter = context.restrictedTraverse("%s" %(line[\'listbox_key\'],))\n
counter.open()\n counter.open()\n
</string> </value> \n
\n
# Set a reference\n
site_id = counter_date.getSiteId()\n
if site_id is None:\n
msg = Message(domain=\'ui\',message="You must define the site")\n
raise ValidationFailed (msg,)\n
counter_date_list = [x.getObject() for x in context.portal_catalog(\n
portal_type=\'Counter Date\',site_id=site_id,\n
sort_on=[(\'start_date\',\'descending\')],limit=1,\n
simulation_state=(\'open\',\'closed\'))]\n
previous_reference = None\n
if len(counter_date_list)>0:\n
previous_counter_date = counter_date_list[0]\n
previous_reference = previous_counter_date.getReference()\n
if previous_reference not in (\'\',None):\n
reference = \'%i\' % (int(previous_reference)+1)\n
else:\n
reference = \'1\'\n
counter_date.setReference(reference)\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -167,6 +191,12 @@ if listbox is not None:\n ...@@ -167,6 +191,12 @@ if listbox is not None:\n
<string>line</string> <string>line</string>
<string>context</string> <string>context</string>
<string>counter</string> <string>counter</string>
<string>site_id</string>
<string>previous_reference</string>
<string>len</string>
<string>previous_counter_date</string>
<string>int</string>
<string>reference</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -51,17 +51,14 @@ ...@@ -51,17 +51,14 @@
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PersistentMapping" module="Persistence.mapping"/>
<string>Persistence</string> <tuple/>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_container</string> </key> <key> <string>data</string> </key>
<value> <value>
<dictionary> <dictionary>
<item> <item>
...@@ -70,6 +67,7 @@ ...@@ -70,6 +67,7 @@
<tuple> <tuple>
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>DestinationAssignee</string>
<string>Manager</string> <string>Manager</string>
<string>Member</string> <string>Member</string>
</tuple> </tuple>
...@@ -87,6 +85,7 @@ ...@@ -87,6 +85,7 @@
<key> <string>Modify portal content</string> </key> <key> <string>Modify portal content</string> </key>
<value> <value>
<tuple> <tuple>
<string>DestinationAssignee</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -97,6 +96,7 @@ ...@@ -97,6 +96,7 @@
<tuple> <tuple>
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>DestinationAssignee</string>
<string>Manager</string> <string>Manager</string>
<string>Member</string> <string>Member</string>
</tuple> </tuple>
......
415 417
\ 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