Commit 8e2812bf authored by Sebastien Robin's avatar Sebastien Robin

remove some code and call a script wich will be used by several modules

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14572 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7f8a3747
...@@ -125,14 +125,8 @@ check_resource = transaction.getAggregateResource()\n ...@@ -125,14 +125,8 @@ check_resource = transaction.getAggregateResource()\n
\n \n
# Automated calculation of the aggregate resource\n # Automated calculation of the aggregate resource\n
if check_resource is None:\n if check_resource is None:\n
entity_portal_type = bank_account.getParentValue().getPortalType()\n check_resource = transaction.Base_getCheckModelByBankAccount(\n
check_model_reference = None\n bank_account=bank_account).getRelativeUrl()\n
if entity_portal_type == \'Person\':\n
check_model_reference = \'CCOP\'\n
elif entity_portal_type == \'Organisation\':\n
check_model_reference = \'CCOP\'\n
check_resource = transaction.Base_getCheckModelByReference(\n
reference=check_model_reference).getRelativeUrl()\n
transaction.edit(aggregate_resource=check_resource)\n transaction.edit(aggregate_resource=check_resource)\n
\n \n
if not check_number:\n if not check_number:\n
...@@ -227,8 +221,6 @@ context.updateBankingOperation(state_change)\n ...@@ -227,8 +221,6 @@ context.updateBankingOperation(state_change)\n
<string>bank_account</string> <string>bank_account</string>
<string>check_number</string> <string>check_number</string>
<string>check_resource</string> <string>check_resource</string>
<string>entity_portal_type</string>
<string>check_model_reference</string>
<string>check</string> <string>check</string>
<string>context</string> <string>context</string>
</tuple> </tuple>
......
...@@ -142,7 +142,10 @@ def checkReferenceListUniqueness(reference_list, model, destination_payment_uid) ...@@ -142,7 +142,10 @@ def checkReferenceListUniqueness(reference_list, model, destination_payment_uid)
Check each given reference not to already exist.\n Check each given reference not to already exist.\n
"""\n """\n
context.log(\'query\', portal.portal_catalog(portal_type=\'Check\', reference=reference_list, destination_payment_uid=destination_payment_uid, resource_relative_url=model, src__=1))\n context.log(\'query\', portal.portal_catalog(portal_type=\'Check\', reference=reference_list, destination_payment_uid=destination_payment_uid, resource_relative_url=model, src__=1))\n
match_list = portal.portal_catalog(portal_type=\'Check\', reference=reference_list, destination_payment_uid=destination_payment_uid, resource_relative_url=model)\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
context.log(\'len\', len(match_list))\n context.log(\'len\', len(match_list))\n
assertReferenceMatchListEmpty(match_list)\n assertReferenceMatchListEmpty(match_list)\n
for reference in reference_list:\n for reference in reference_list:\n
...@@ -197,7 +200,7 @@ for line in line_list:\n ...@@ -197,7 +200,7 @@ for line in line_list:\n
destination_trade = line.getDestinationTrade()\n destination_trade = line.getDestinationTrade()\n
else:\n else:\n
destination_payment_value = None\n destination_payment_value = None\n
destination_payment_uid = "dummy"\n destination_payment_uid = None\n
\n \n
aggregate_list = []\n aggregate_list = []\n
for i in xrange(quantity):\n for i in xrange(quantity):\n
...@@ -217,13 +220,13 @@ for line in line_list:\n ...@@ -217,13 +220,13 @@ for line in line_list:\n
item.setTitle(\'%s - %s\' % (reference_range_min, reference_range_max))\n item.setTitle(\'%s - %s\' % (reference_range_min, reference_range_max))\n
item.setCheckAmount(check_amount)\n item.setCheckAmount(check_amount)\n
destination_section = item.getDestinationSection()\n destination_section = item.getDestinationSection()\n
for reference in reference_list:\n for j in reference_list:\n
tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, reference)\n tag = \'check_%s_%s_%s\' % (model, destination_payment_uid, j)\n
encountered_check_identifiers_dict[tag] = None\n encountered_check_identifiers_dict[tag] = None\n
check = item.newContent(portal_type=\'Check\', title=str(reference), activate_kw={\'tag\': tag})\n check = item.newContent(portal_type=\'Check\', title=j, activate_kw={\'tag\': tag})\n
check.setDestination(destination_section)\n check.setDestination(destination_section)\n
check.setStartDate(start_date)\n check.setStartDate(start_date)\n
check.setReference(reference)\n check.setReference(j)\n
check.setResource(model)\n check.setResource(model)\n
else:\n else:\n
checkReferenceUniqueness(reference_range_min, model, destination_payment_uid)\n checkReferenceUniqueness(reference_range_min, model, destination_payment_uid)\n
...@@ -350,10 +353,9 @@ for line in line_list:\n ...@@ -350,10 +353,9 @@ for line in line_list:\n
<string>reference_list</string> <string>reference_list</string>
<string>reference_range_max</string> <string>reference_range_max</string>
<string>destination_section</string> <string>destination_section</string>
<string>reference</string> <string>j</string>
<string>tag</string> <string>tag</string>
<string>_write_</string> <string>_write_</string>
<string>str</string>
<string>check</string> <string>check</string>
<string>len</string> <string>len</string>
<string>item_type</string> <string>item_type</string>
......
240 242
\ 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