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 encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
checkbook_reception = context.getParentValue()\n
\n
# Check getBaobabSource and getBaobabDestination\n
checkbook_reception.Base_checkBaobabSourceAndDestination()\n
\n
portal = checkbook_reception.getPortalObject()\n
portal_activities = portal.portal_activities\n
if encountered_check_identifiers_dict is None:\n
encountered_check_identifiers_dict = {}\n
\n
def getReference(reference):\n
"""\n
Convert a reference into an int.\n
"""\n
# First convert to float to avoid failing to convert if reference = \'1.0\'\n
return int(float(reference))\n
\n
def generateReference(reference, original_reference):\n
"""\n
Convert an int into a reference of correct length\n
"""\n
reference = str(reference)\n
return \'%s%s\' % (\'0\' * (len(original_reference) - len(reference)), reference)\n
\n
def validateTravelerCheckReferenceFormat(traveler_check_reference):\n
"""\n
Check provided traveler_check_reference format\n
"""\n
if len(traveler_check_reference) != 10:\n
message = Message(domain=\'ui\', message=\'Traveler check reference must be 10-char long.\')\n
raise ValueError, (message,)\n
int(traveler_check_reference[4:])\n
\n
def getTravelerCheckReferenceNumber(traveler_check_reference):\n
"""\n
Extract traveler check reference number\n
"""\n
validateTravelerCheckReferenceFormat(traveler_check_reference)\n
return int(traveler_check_reference[4:])\n
\n
def getTravelerCheckReferencePrefix(traveler_check_reference):\n
"""\n
Extract traveler check reference prefix\n
"""\n
validateTravelerCheckReferenceFormat(traveler_check_reference)\n
return traveler_check_reference[:4]\n
\n
def generateTravelerCheckReference(number, original_traveler_check_reference):\n
"""\n
Generate a traveler check reference from an existing reference (to\n
extract its prefix) and a new numerical value.\n
"""\n
if not same_type(number, 0):\n
message = Message(domain=\'ui\', message=\'Traveler check number must be only numeric.\')\n
raise ValueError, (message, )\n
if len(str(number)) > 6:\n
message = Message(domain=\'ui\', message=\'Traveler check number representation length must not exceed 6 char.\')\n
raise ValueError, (message,)\n
prefix = getTravelerCheckReferencePrefix(original_traveler_check_reference)\n
return \'%s%06d\' % (prefix, number)\n
\n
def assertReferenceMatchListEmpty(match_list):\n
"""\n
Check that the list is empty, otherwise gather all conflicting references and display them in the error message.\n
TODO: make the error message Localizer-friendly\n
"""\n
if len(match_list) > 0:\n
matched_reference_list = []\n
for match in match_list:\n
matched_reference_list.append(match.getReference())\n
message = Message(domain=\'ui\', message=\'The following references are already allocated : $reference_list\',\n
mapping={\'reference_list\': matched_reference_list})\n
raise ValidationFailed, (message,)\n
\n
def checkReferenceListUniqueness(reference_list, model, destination_payment_uid):\n
"""\n
Check each given reference not to already exist.\n
"""\n
if destination_payment_uid is None:\n
match_list = portal.portal_catalog(portal_type=\'Check\', reference=reference_list, resource_relative_url=model)\n
else:\n
match_list = portal.portal_catalog(portal_type=\'Check\', reference=reference_list, destination_payment_uid=destination_payment_uid, resource_relative_url=model)\n
assertReferenceMatchListEmpty(match_list)\n
for reference in reference_list:\n
tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, reference)\n
if encountered_check_identifiers_dict.has_key(tag):\n
message = Message(domain=\'ui\', message=\'The following references are already allocated : $reference_list\',\n
mapping={\'reference_list\': [reference, ]})\n
raise ValidationFailed, (message,)\n
encountered_check_identifiers_dict[tag] = None\n
\n
def checkReferenceUniqueness(reference, model, destination_payment_uid):\n
"""\n
Check the given reference not to already exist.\n
"""\n
checkReferenceListUniqueness([reference, ], model, destination_payment_uid)\n
\n
start_date = checkbook_reception.getStartDate()\n
destination = checkbook_reception.getDestination()\n
\n
line = context\n
quantity = line.getQuantity()\n
resource = line.getResourceValue()\n
reference_range_min = line.getReferenceRangeMin()\n
\n
# We will look where we should create as many items\n
# as necessary and construct by the same time\n
# the aggregate list that we will store on the line\n
resource_portal_type = resource.getPortalType()\n
if resource_portal_type == \'Checkbook Model\':\n
is_checkbook = True\n
module = portal.checkbook_module\n
model = resource.getComposition()\n
# XXX: portal_type value is hardcoded because I don\'t want to get the\n
# portaltype on each created object as it will always be the same.\n
# We need a method to get the default content portaltype on a Folder.\n
check_amount = line.getCheckAmount()\n
check_quantity = int(portal.restrictedTraverse(check_amount).getQuantity())\n
reference_to_int = getReference\n
int_to_reference = generateReference\n
else:\n
is_checkbook = False\n
module = portal.check_module\n
model = resource.getRelativeUrl()\n
# XXX: portal_type value is hardcoded, see XXX above.\n
if resource_portal_type == \'Check Model\' and resource.isFixedPrice():\n
reference_to_int = getTravelerCheckReferenceNumber\n
int_to_reference = generateTravelerCheckReference\n
else:\n
reference_to_int = getReference\n
int_to_reference = generateReference\n
\n
if resource.getAccountNumberEnabled():\n
destination_payment_value = line.getDestinationPaymentValue()\n
# Not required any more to serialize the bank account\n
#destination_payment_value.serialize()\n
destination_payment_uid = destination_payment_value.getUid()\n
destination_trade = line.getDestinationTrade()\n
else:\n
destination_payment_value = None\n
destination_payment_uid = None\n
\n
aggregate_list = []\n
for i in xrange(quantity):\n
if create == 1:\n
item = module.newContent()\n
item.setDestination(destination)\n
if destination_payment_value is not None:\n
item.setDestinationPaymentValue(destination_payment_value)\n
item.setDestinationTrade(destination_trade)\n
if is_checkbook:\n
last_reference_value = reference_to_int(reference_range_min) + check_quantity - 1\n
reference_list = [int_to_reference(x, reference_range_min) for x in range(reference_to_int(reference_range_min), last_reference_value + 1)]\n
reference_range_max = int_to_reference(last_reference_value, reference_range_min)\n
if check == 1:\n
checkReferenceListUniqueness(reference_list, model, destination_payment_uid)\n
if create == 1:\n
item.setReferenceRangeMax(reference_range_max)\n
item.setReferenceRangeMin(reference_range_min)\n
item.setResourceValue(resource)\n
item.setStartDate(start_date)\n
item.setTitle(\'%s - %s\' % (reference_range_min, reference_range_max))\n
item.setCheckAmount(check_amount)\n
destination_section = item.getDestinationSection()\n
for j in reference_list:\n
#tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, j)\n
#encountered_check_identifiers_dict[tag] = None\n
check = item.newContent(portal_type=\'Check\', title=j, activate_kw={\'tag\': tag})\n
check.setDestination(destination_section)\n
check.setStartDate(start_date)\n
check.setReference(j)\n
check.setResource(model)\n
else:\n
if check == 1:\n
checkReferenceUniqueness(reference_range_min, model, destination_payment_uid)\n
if create == 1:\n
item.setReference(reference_range_min)\n
item.setResource(model)\n
item.setTitle(reference_range_min)\n
if len(resource.objectValues()) > 0:\n
item_type = line.getCheckTypeValue()\n
item.setPrice(item_type.getPrice())\n
item.setPriceCurrency(line.getPriceCurrency())\n
last_reference_value = reference_to_int(reference_range_min)\n
#tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, reference_range_min)\n
#encountered_check_identifiers_dict[tag] = None\n
# update reference_range_min for the next pass\n
reference_range_min = int_to_reference(last_reference_value + 1, reference_range_min)\n
# I (seb) think this is a big mistake\n
#if item.getPortalType()==\'Check\':\n
# portal.portal_workflow.doActionFor(item,\'confirm_action\',\n
# wf_id=\'check_workflow\')\n
if create == 1:\n
aggregate_list.append(item)\n
\n
# Finally set the aggregate list on the line\n
if create == 1:\n
line.setAggregateValueList(aggregate_list)\n
\n
return encountered_check_identifiers_dict\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, tag=None, encountered_check_identifiers_dict=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</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>4</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>check</string>
<string>create</string>
<string>tag</string>
<string>encountered_check_identifiers_dict</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getattr_</string>
<string>context</string>
<string>checkbook_reception</string>
<string>portal</string>
<string>portal_activities</string>
<string>None</string>
<string>getReference</string>
<string>generateReference</string>
<string>validateTravelerCheckReferenceFormat</string>
<string>getTravelerCheckReferenceNumber</string>
<string>getTravelerCheckReferencePrefix</string>
<string>generateTravelerCheckReference</string>
<string>assertReferenceMatchListEmpty</string>
<string>checkReferenceListUniqueness</string>
<string>checkReferenceUniqueness</string>
<string>start_date</string>
<string>destination</string>
<string>line</string>
<string>quantity</string>
<string>resource</string>
<string>reference_range_min</string>
<string>resource_portal_type</string>
<string>True</string>
<string>is_checkbook</string>
<string>module</string>
<string>model</string>
<string>check_amount</string>
<string>int</string>
<string>check_quantity</string>
<string>reference_to_int</string>
<string>int_to_reference</string>
<string>False</string>
<string>destination_payment_value</string>
<string>destination_payment_uid</string>
<string>destination_trade</string>
<string>aggregate_list</string>
<string>_getiter_</string>
<string>xrange</string>
<string>i</string>
<string>item</string>
<string>last_reference_value</string>
<string>append</string>
<string>$append0</string>
<string>range</string>
<string>x</string>
<string>reference_list</string>
<string>reference_range_max</string>
<string>destination_section</string>
<string>j</string>
<string>len</string>
<string>item_type</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<int>0</int>
<int>0</int>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CheckbookReceptionLine_checkOrCreateItemList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="FloatField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_aggregate_price</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>not_float</string> </key>
<value> <string>You did not enter a floating point number.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>listbox_aggregate_price</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: cell.getAggregateValue().getPrice()</string> </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>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="FloatField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_aggregate_price</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>not_float</string> </key>
<value> <string>You did not enter a floating point number.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>listbox_aggregate_price</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: cell.getAggregateValue().getPrice()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,188 +68,206 @@
<value> <string encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
transaction = state_change[\'object\']\n
\n
# Check getBaobabSource and getBaobabDestination\n
transaction.Base_checkBaobabSourceAndDestination()\n
\n
portal = transaction.getPortalObject()\n
portal_activities = portal.portal_activities\n
line_list = transaction.objectValues()\n
encountered_check_identifiers_dict = {}\n
\n
def getReference(reference):\n
"""\n
Convert a reference into an int.\n
"""\n
# First convert to float to avoid failing to convert if reference = \'1.0\'\n
return int(float(reference))\n
\n
def generateReference(reference, original_reference):\n
"""\n
Convert an int into a reference of correct length\n
"""\n
reference = str(reference)\n
return \'%s%s\' % (\'0\' * (len(original_reference) - len(reference)), reference)\n
\n
def validateTravelerCheckReferenceFormat(traveler_check_reference):\n
"""\n
Check provided traveler_check_reference format\n
"""\n
if len(traveler_check_reference) != 10:\n
raise ValueError, \'Traveler check reference must be 10-char long.\'\n
int(traveler_check_reference[4:])\n
\n
def getTravelerCheckReferenceNumber(traveler_check_reference):\n
"""\n
Extract traveler check reference number\n
"""\n
validateTravelerCheckReferenceFormat(traveler_check_reference)\n
return int(traveler_check_reference[4:])\n
\n
def getTravelerCheckReferencePrefix(traveler_check_reference):\n
"""\n
Extract traveler check reference prefix\n
"""\n
validateTravelerCheckReferenceFormat(traveler_check_reference)\n
return traveler_check_reference[:4]\n
\n
def generateTravelerCheckReference(number, original_traveler_check_reference):\n
"""\n
Generate a traveler check reference from an existing reference (to\n
extract its prefix) and a new numerical value.\n
"""\n
if not same_type(number, 0):\n
raise ValueError, \'Traveler check number must be only numeric.\'\n
if len(str(number)) > 6:\n
raise ValueError, \'Traveler check number representation length must not exceed 6 char.\'\n
prefix = getTravelerCheckReferencePrefix(original_traveler_check_reference)\n
return \'%s%06d\' % (prefix, number)\n
\n
def assertReferenceMatchListEmpty(match_list):\n
"""\n
Check that the list is empty, otherwise gather all conflicting references and display them in the error message.\n
TODO: make the error message Localizer-friendly\n
"""\n
if len(match_list) > 0:\n
matched_reference_list = []\n
for match in match_list:\n
matched_reference_list.append(match.getReference())\n
raise ValidationFailed, \'The following references are already allocated : %s\' % (matched_reference_list, )\n
\n
def checkReferenceListUniqueness(reference_list, model, destination_payment_uid):\n
"""\n
Check each given reference not to already exist.\n
"""\n
if destination_payment_uid is None:\n
match_list = portal.portal_catalog(portal_type=\'Check\', reference=reference_list, resource_relative_url=model)\n
else:\n
match_list = portal.portal_catalog(portal_type=\'Check\', reference=reference_list, destination_payment_uid=destination_payment_uid, resource_relative_url=model)\n
assertReferenceMatchListEmpty(match_list)\n
for reference in reference_list:\n
tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, reference)\n
if encountered_check_identifiers_dict.has_key(tag) or portal_activities.countMessageWithTag(tag) != 0:\n
raise ValidationFailed, \'The following references are already allocated : %s\' % ([reference, ], )\n
\n
def checkReferenceUniqueness(reference, model, destination_payment_uid):\n
"""\n
Check the given reference not to already exist.\n
"""\n
checkReferenceListUniqueness([reference, ], model, destination_payment_uid)\n
\n
start_date = transaction.getStartDate()\n
\n
for line in line_list:\n
quantity = line.getQuantity()\n
resource = line.getResourceValue()\n
reference_range_min = line.getReferenceRangeMin()\n
# Check that all lines do not define existing checks or checkbooks\n
transaction.CheckbookReception_checkOrCreateItemList(check=1)\n
\n
# We will look where we should create as many items\n
# as necessary and construct by the same time\n
# the aggregate list that we will store on the line\n
resource_portal_type = resource.getPortalType()\n
if resource_portal_type == \'Checkbook Model\':\n
is_checkbook = True\n
module = portal.checkbook_module\n
model = resource.getComposition()\n
# XXX: portal_type value is hardcoded because I don\'t want to get the\n
# portaltype on each created object as it will always be the same.\n
# We need a method to get the default content portaltype on a Folder.\n
check_amount = line.getCheckAmount()\n
check_quantity = int(portal.restrictedTraverse(check_amount).getQuantity())\n
reference_to_int = getReference\n
int_to_reference = generateReference\n
else:\n
is_checkbook = False\n
module = portal.check_module\n
model = resource.getRelativeUrl()\n
# XXX: portal_type value is hardcoded, see XXX above.\n
if resource_portal_type == \'Check Model\' and resource.isFixedPrice():\n
reference_to_int = getTravelerCheckReferenceNumber\n
int_to_reference = generateTravelerCheckReference\n
else:\n
reference_to_int = getReference\n
int_to_reference = generateReference\n
# Start activities for each line\n
transaction.CheckbookReception_checkOrCreateItemList(create=1)\n
\n
if resource.getAccountNumberEnabled():\n
destination_payment_value = line.getDestinationPaymentValue()\n
destination_payment_value.serialize()\n
destination_payment_uid = destination_payment_value.getUid()\n
destination_trade = line.getDestinationTrade()\n
else:\n
destination_payment_value = None\n
destination_payment_uid = None\n
\n
aggregate_list = []\n
for i in xrange(quantity):\n
item = module.newContent()\n
if destination_payment_value is not None:\n
item.setDestinationPaymentValue(destination_payment_value)\n
item.setDestinationTrade(destination_trade)\n
if is_checkbook:\n
last_reference_value = reference_to_int(reference_range_min) + check_quantity - 1\n
reference_list = [int_to_reference(x, reference_range_min) for x in range(reference_to_int(reference_range_min), last_reference_value + 1)]\n
checkReferenceListUniqueness(reference_list, model, destination_payment_uid)\n
reference_range_max = int_to_reference(last_reference_value, reference_range_min)\n
item.setReferenceRangeMax(reference_range_max)\n
item.setReferenceRangeMin(reference_range_min)\n
item.setResourceValue(resource)\n
item.setStartDate(start_date)\n
item.setTitle(\'%s - %s\' % (reference_range_min, reference_range_max))\n
item.setCheckAmount(check_amount)\n
destination_section = item.getDestinationSection()\n
for j in reference_list:\n
tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, j)\n
encountered_check_identifiers_dict[tag] = None\n
check = item.newContent(portal_type=\'Check\', title=j, activate_kw={\'tag\': tag})\n
check.setDestination(destination_section)\n
check.setStartDate(start_date)\n
check.setReference(j)\n
check.setResource(model)\n
else:\n
checkReferenceUniqueness(reference_range_min, model, destination_payment_uid)\n
item.setReference(reference_range_min)\n
item.setResource(model)\n
item.setTitle(reference_range_min)\n
if len(resource.objectValues()) > 0:\n
item_type = line.getCheckTypeValue()\n
item.setPrice(item_type.getPrice())\n
item.setPriceCurrency(line.getPriceCurrency())\n
last_reference_value = reference_to_int(reference_range_min)\n
tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, reference_range_min)\n
encountered_check_identifiers_dict[tag] = None\n
# Trigger a dummy activity just to avoi dbeing able to create that check multiple times in the same checkbook reception\n
item.activate(tag=tag).getUid()\n
# update reference_range_min for the next pass\n
reference_range_min = int_to_reference(last_reference_value + 1, reference_range_min)\n
# I (seb) think this is a big mistake\n
#if item.getPortalType()==\'Check\':\n
# portal.portal_workflow.doActionFor(item,\'confirm_action\',\n
# wf_id=\'check_workflow\')\n
aggregate_list.append(item)\n
\n
# Finally set the aggregate list on the line\n
line.setAggregateValueList(aggregate_list)\n
#from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
#transaction = state_change[\'object\']\n
#\n
## Check getBaobabSource and getBaobabDestination\n
#transaction.Base_checkBaobabSourceAndDestination()\n
#\n
#portal = transaction.getPortalObject()\n
#portal_activities = portal.portal_activities\n
#line_list = transaction.objectValues()\n
#encountered_check_identifiers_dict = {}\n
#\n
#def getReference(reference):\n
# """\n
# Convert a reference into an int.\n
# """\n
# # First convert to float to avoid failing to convert if reference = \'1.0\'\n
# return int(float(reference))\n
#\n
#def generateReference(reference, original_reference):\n
# """\n
# Convert an int into a reference of correct length\n
# """\n
# reference = str(reference)\n
# return \'%s%s\' % (\'0\' * (len(original_reference) - len(reference)), reference)\n
#\n
#def validateTravelerCheckReferenceFormat(traveler_check_reference):\n
# """\n
# Check provided traveler_check_reference format\n
# """\n
# if len(traveler_check_reference) != 10:\n
# raise ValueError, \'Traveler check reference must be 10-char long.\'\n
# int(traveler_check_reference[4:])\n
#\n
#def getTravelerCheckReferenceNumber(traveler_check_reference):\n
# """\n
# Extract traveler check reference number\n
# """\n
# validateTravelerCheckReferenceFormat(traveler_check_reference)\n
# return int(traveler_check_reference[4:])\n
#\n
#def getTravelerCheckReferencePrefix(traveler_check_reference):\n
# """\n
# Extract traveler check reference prefix\n
# """\n
# validateTravelerCheckReferenceFormat(traveler_check_reference)\n
# return traveler_check_reference[:4]\n
#\n
#def generateTravelerCheckReference(number, original_traveler_check_reference):\n
# """\n
# Generate a traveler check reference from an existing reference (to\n
# extract its prefix) and a new numerical value.\n
# """\n
# if not same_type(number, 0):\n
# raise ValueError, \'Traveler check number must be only numeric.\'\n
# if len(str(number)) > 6:\n
# raise ValueError, \'Traveler check number representation length must not exceed 6 char.\'\n
# prefix = getTravelerCheckReferencePrefix(original_traveler_check_reference)\n
# return \'%s%06d\' % (prefix, number)\n
#\n
#def assertReferenceMatchListEmpty(match_list):\n
# """\n
# Check that the list is empty, otherwise gather all conflicting references and display them in the error message.\n
# TODO: make the error message Localizer-friendly\n
# """\n
# if len(match_list) > 0:\n
# matched_reference_list = []\n
# for match in match_list:\n
# matched_reference_list.append(match.getReference())\n
# raise ValidationFailed, \'The following references are already allocated : %s\' % (matched_reference_list, )\n
#\n
#def checkReferenceListUniqueness(reference_list, model, destination_payment_uid):\n
# """\n
# Check each given reference not to already exist.\n
# """\n
# if destination_payment_uid is None:\n
# match_list = portal.portal_catalog(portal_type=\'Check\', reference=reference_list, resource_relative_url=model)\n
# else:\n
# match_list = portal.portal_catalog(portal_type=\'Check\', reference=reference_list, destination_payment_uid=destination_payment_uid, resource_relative_url=model)\n
# assertReferenceMatchListEmpty(match_list)\n
# for reference in reference_list:\n
# tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, reference)\n
# if encountered_check_identifiers_dict.has_key(tag) or portal_activities.countMessageWithTag(tag) != 0:\n
# raise ValidationFailed, \'The following references are already allocated : %s\' % ([reference, ], )\n
#\n
#def checkReferenceUniqueness(reference, model, destination_payment_uid):\n
# """\n
# Check the given reference not to already exist.\n
# """\n
# checkReferenceListUniqueness([reference, ], model, destination_payment_uid)\n
#\n
#start_date = transaction.getStartDate()\n
#destination = transaction.getDestination()\n
#\n
#for line in line_list:\n
# quantity = line.getQuantity()\n
# resource = line.getResourceValue()\n
# reference_range_min = line.getReferenceRangeMin()\n
#\n
# # We will look where we should create as many items\n
# # as necessary and construct by the same time\n
# # the aggregate list that we will store on the line\n
# resource_portal_type = resource.getPortalType()\n
# if resource_portal_type == \'Checkbook Model\':\n
# is_checkbook = True\n
# module = portal.checkbook_module\n
# model = resource.getComposition()\n
# # XXX: portal_type value is hardcoded because I don\'t want to get the\n
# # portaltype on each created object as it will always be the same.\n
# # We need a method to get the default content portaltype on a Folder.\n
# check_amount = line.getCheckAmount()\n
# check_quantity = int(portal.restrictedTraverse(check_amount).getQuantity())\n
# reference_to_int = getReference\n
# int_to_reference = generateReference\n
# else:\n
# is_checkbook = False\n
# module = portal.check_module\n
# model = resource.getRelativeUrl()\n
# # XXX: portal_type value is hardcoded, see XXX above.\n
# if resource_portal_type == \'Check Model\' and resource.isFixedPrice():\n
# reference_to_int = getTravelerCheckReferenceNumber\n
# int_to_reference = generateTravelerCheckReference\n
# else:\n
# reference_to_int = getReference\n
# int_to_reference = generateReference\n
#\n
# if resource.getAccountNumberEnabled():\n
# destination_payment_value = line.getDestinationPaymentValue()\n
# destination_payment_value.serialize()\n
# destination_payment_uid = destination_payment_value.getUid()\n
# destination_trade = line.getDestinationTrade()\n
# else:\n
# destination_payment_value = None\n
# destination_payment_uid = None\n
#\n
# aggregate_list = []\n
# for i in xrange(quantity):\n
# item = module.newContent()\n
# item.setDestination(destination)\n
# if destination_payment_value is not None:\n
# item.setDestinationPaymentValue(destination_payment_value)\n
# item.setDestinationTrade(destination_trade)\n
# if is_checkbook:\n
# last_reference_value = reference_to_int(reference_range_min) + check_quantity - 1\n
# reference_list = [int_to_reference(x, reference_range_min) for x in range(reference_to_int(reference_range_min), last_reference_value + 1)]\n
# checkReferenceListUniqueness(reference_list, model, destination_payment_uid)\n
# reference_range_max = int_to_reference(last_reference_value, reference_range_min)\n
# item.setReferenceRangeMax(reference_range_max)\n
# item.setReferenceRangeMin(reference_range_min)\n
# item.setResourceValue(resource)\n
# item.setStartDate(start_date)\n
# item.setTitle(\'%s - %s\' % (reference_range_min, reference_range_max))\n
# item.setCheckAmount(check_amount)\n
# destination_section = item.getDestinationSection()\n
# for j in reference_list:\n
# tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, j)\n
# encountered_check_identifiers_dict[tag] = None\n
# check = item.newContent(portal_type=\'Check\', title=j, activate_kw={\'tag\': tag})\n
# check.setDestination(destination_section)\n
# check.setStartDate(start_date)\n
# check.setReference(j)\n
# check.setResource(model)\n
# else:\n
# checkReferenceUniqueness(reference_range_min, model, destination_payment_uid)\n
# item.setReference(reference_range_min)\n
# item.setResource(model)\n
# item.setTitle(reference_range_min)\n
# if len(resource.objectValues()) > 0:\n
# item_type = line.getCheckTypeValue()\n
# item.setPrice(item_type.getPrice())\n
# item.setPriceCurrency(line.getPriceCurrency())\n
# last_reference_value = reference_to_int(reference_range_min)\n
# tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, reference_range_min)\n
# encountered_check_identifiers_dict[tag] = None\n
# # Trigger a dummy activity just to avoi dbeing able to create that check multiple times in the same checkbook reception\n
# item.activate(tag=tag).getUid()\n
# # update reference_range_min for the next pass\n
# reference_range_min = int_to_reference(last_reference_value + 1, reference_range_min)\n
# # I (seb) think this is a big mistake\n
# #if item.getPortalType()==\'Check\':\n
# # portal.portal_workflow.doActionFor(item,\'confirm_action\',\n
# # wf_id=\'check_workflow\')\n
# aggregate_list.append(item)\n
#\n
# # Finally set the aggregate list on the line\n
# line.setAggregateValueList(aggregate_list)\n
]]></string> </value>
......@@ -297,61 +315,11 @@ for line in line_list:\n
<string>state_change</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getitem_</string>
<string>transaction</string>
<string>_getattr_</string>
<string>portal</string>
<string>portal_activities</string>
<string>line_list</string>
<string>encountered_check_identifiers_dict</string>
<string>getReference</string>
<string>generateReference</string>
<string>validateTravelerCheckReferenceFormat</string>
<string>getTravelerCheckReferenceNumber</string>
<string>getTravelerCheckReferencePrefix</string>
<string>generateTravelerCheckReference</string>
<string>assertReferenceMatchListEmpty</string>
<string>checkReferenceListUniqueness</string>
<string>checkReferenceUniqueness</string>
<string>start_date</string>
<string>_getiter_</string>
<string>line</string>
<string>quantity</string>
<string>resource</string>
<string>reference_range_min</string>
<string>resource_portal_type</string>
<string>True</string>
<string>is_checkbook</string>
<string>module</string>
<string>model</string>
<string>check_amount</string>
<string>int</string>
<string>check_quantity</string>
<string>reference_to_int</string>
<string>int_to_reference</string>
<string>False</string>
<string>destination_payment_value</string>
<string>destination_payment_uid</string>
<string>destination_trade</string>
<string>None</string>
<string>aggregate_list</string>
<string>xrange</string>
<string>i</string>
<string>item</string>
<string>last_reference_value</string>
<string>append</string>
<string>$append0</string>
<string>range</string>
<string>x</string>
<string>reference_list</string>
<string>reference_range_max</string>
<string>destination_section</string>
<string>j</string>
<string>tag</string>
<string>_write_</string>
<string>check</string>
<string>len</string>
<string>item_type</string>
</tuple>
</value>
</item>
......
......@@ -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