Commit c0e70952 authored by Sebastien Robin's avatar Sebastien Robin

- now we create check items and checkbook items with activities, this allow

to create many checkbooks without waiting several minutes.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15345 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 946acc9c
......@@ -95,7 +95,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:object.getSimulationState() == \'empty\' </string> </value>
<value> <string>python:object.getSimulationState() in (\'empty\', \'rejected\')</string> </value>
</item>
</dictionary>
</pickle>
......
<?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># It was decided that it is possible to receive in an agency only\n
# checks and checkbooks for accounts managed by that agency. Moreover\n
# we have decided that we will not allow many checkbook reception at\n
# a time inside an agency, like this we can create many activities with\n
# the tag "CheckbookReception_[Agency Code or Url]" in order to make sure\n
# we will not do duplicate (of course we check that there is not already\n
# a check or checkbook with this references.\n
\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
destination_id = context.getDestinationId()\n
if destination_id is None:\n
msg = Message(domain=\'ui\', message=\'Sorry, you must define the site\')\n
raise ValidationFailed, (msg, )\n
\n
# first check that there is not a particular tag\n
checkbook_reception_tag = "CheckbookReception_%s" % destination_id\n
if context.portal_activities.countMessageWithTag(checkbook_reception_tag) != 0:\n
msg = Message(domain=\'ui\', message=\'Sorry, there is already a checkbook reception newly validated\')\n
raise ValidationFailed, (msg, )\n
\n
line_list = context.objectValues(portal_type=\'Checkbook Reception Line\')\n
if check == 1:\n
encountered_check_identifiers_dict = {}\n
for line in line_list:\n
encountered_check_identifiers_dict = line.CheckbookReceptionLine_checkOrCreateItemList(check=1, \n
encountered_check_identifiers_dict=encountered_check_identifiers_dict)\n
\n
if create==1:\n
for line in line_list:\n
line.activate(tag=checkbook_reception_tag).\\\n
CheckbookReceptionLine_checkOrCreateItemList(create=1, tag=checkbook_reception_tag)\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>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>check=0, create=0</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>check</string>
<string>create</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getattr_</string>
<string>context</string>
<string>destination_id</string>
<string>None</string>
<string>msg</string>
<string>checkbook_reception_tag</string>
<string>line_list</string>
<string>encountered_check_identifiers_dict</string>
<string>_getiter_</string>
<string>line</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<int>0</int>
<int>0</int>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CheckbookReception_checkOrCreateItemList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -95,7 +95,9 @@
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
<list>
<string>listbox_aggregate_price</string>
</list>
</value>
</item>
<item>
......
......@@ -360,6 +360,10 @@
<string>destination_trade_title</string>
<string>Owner</string>
</tuple>
<tuple>
<string>aggregate_price</string>
<string>Price</string>
</tuple>
</list>
</value>
</item>
......@@ -402,7 +406,12 @@
<item>
<key> <string>editable_columns</string> </key>
<value>
<list/>
<list>
<tuple>
<string>aggregate_price</string>
<string>aggregate_price</string>
</tuple>
</list>
</value>
</item>
<item>
......@@ -527,11 +536,8 @@
<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>
......
......@@ -95,7 +95,9 @@
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
<list>
<string>listbox_aggregate_price</string>
</list>
</value>
</item>
<item>
......
......@@ -360,6 +360,10 @@
<string>destination_trade_title</string>
<string>Owner</string>
</tuple>
<tuple>
<string>aggregate_price</string>
<string>Price</string>
</tuple>
</list>
</value>
</item>
......@@ -402,7 +406,12 @@
<item>
<key> <string>editable_columns</string> </key>
<value>
<list/>
<list>
<tuple>
<string>aggregate_price</string>
<string>aggregate_price</string>
</tuple>
</list>
</value>
</item>
<item>
......@@ -527,11 +536,8 @@
<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>
......
......@@ -43,8 +43,8 @@
<string>confirm_action</string>
<string>delete</string>
<string>delete_action</string>
<string>reject</string>
<string>reject_action</string>
<string>draft</string>
<string>draft_action</string>
</tuple>
</value>
</item>
......
303
\ No newline at end of file
305
\ 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