[Erp5-report] r25382 - /erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_in...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jan 30 14:27:49 CET 2009
Author: jerome
Date: Fri Jan 30 14:27:48 2009
New Revision: 25382
URL: http://svn.erp5.org?rev=25382&view=rev
Log:
merge InvoiceTransaction_postGenerationActivity into InvoiceTransaction_postGeneration it's no longer required to wait for activities to set causality
Removed:
erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postGenerationActivity.xml
Removed: erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postGenerationActivity.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postGenerationActivity.xml?rev=25381&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postGenerationActivity.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postGenerationActivity.xml (removed)
@@ -1,212 +1,0 @@
-<?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>Script_magic</string> </key>
- <value> <int>3</int> </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>#\n
-# this script is called in an activity on the Sale Invoice Transaction\n
-# after the invoice_builder delivery builder has created\n
-# the new Sale Invoice Transaction\n
-#\n
-from Products.ERP5Type.Message import translateString\n
-try:\n
- from Products.CMFCore.WorkflowCore import WorkflowException\n
-except ImportError:\n
- # WorkflowException has not always been allowed in restricted\n
- # environment, in this case, make sure WorkflowException is \n
- # defined \n
- class WorkflowException(Exception):\n
- pass\n
-\n
-# Return Message object, so that this message will be translated when it is rendered later.\n
-\n
-invoice = context\n
-from Products.ERP5Type.Log import log\n
-LOG = lambda msg:log(\n
- "InvoiceTransaction_postGenerationActivity on %s" % (invoice.getPath()), msg)\n
-\n
-related_packing_list = invoice.getDefaultCausalityValue()\n
-#LOG(\'causality %s \' %invoice.getCausalityValueList())\n
-\n
-# XXX this use of currency is completly bogus, it should be set on simulation movements.\n
-# get a price_currency from the packing list, or the order\n
-price_currency = related_packing_list.getPriceCurrency()\n
-if price_currency:\n
- invoice.edit(\n
- resource=price_currency,\n
- price_currency=price_currency,)\n
-else:\n
- related_order = related_packing_list.getDefaultCausalityValue()\n
- if related_order is not None:\n
- price_currency = related_order.getPriceCurrency()\n
- invoice.edit(\n
- resource=price_currency,\n
- price_currency=price_currency,)\n
-\n
-\n
-# copy trade condition:\n
-if not context.getSpecialise():\n
- related_order = related_packing_list.getDefaultCausalityValue()\n
- if related_order is not None:\n
- context.edit(specialise=related_order.getSpecialise())\n
-\n
-# copy title, if not updating a new delivery\n
-if not invoice.hasTitle() and related_packing_list.hasTitle():\n
- invoice.setTitle(related_packing_list.getTitle())\n
-\n
-# initialize accounting_workflow to planned state\n
-if invoice.getSimulationState() == \'draft\':\n
- try :\n
- context.getPortalObject().portal_workflow.doActionFor(\n
- invoice, \'confirm_action\',\n
- comment=translateString(\'Initialized by Delivery Builder.\'),\n
- skip_period_validation=1)\n
- except WorkflowException, e:\n
- # The user cannot pass the transition, it\'s OK\n
- pass\n
-\n
- if invoice.getSimulationState() == \'draft\':\n
- # call the workflow method, if the user cannot perform this operation.\n
- invoice.confirm()\n
-\n
-# First set the invoice in the building state on the causality workflow\n
-invoice.startBuilding()\n
-\n
-# Then an activity should put the causality state in diverged or solved\n
-invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list,\n
- (\'immediateReindexObject\',\'recursiveImmediateReindexObject\'))).updateCausalityState()\n
-</string> </value>
- </item>
- <item>
- <key> <string>_code</string> </key>
- <value>
- <none/>
- </value>
- </item>
- <item>
- <key> <string>_params</string> </key>
- <value> <string>related_simulation_movement_path_list=None, **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>related_simulation_movement_path_list</string>
- <string>kw</string>
- <string>Products.ERP5Type.Message</string>
- <string>translateString</string>
- <string>Products.CMFCore.WorkflowCore</string>
- <string>WorkflowException</string>
- <string>ImportError</string>
- <string>Exception</string>
- <string>context</string>
- <string>invoice</string>
- <string>Products.ERP5Type.Log</string>
- <string>log</string>
- <string>LOG</string>
- <string>_getattr_</string>
- <string>related_packing_list</string>
- <string>price_currency</string>
- <string>related_order</string>
- <string>None</string>
- <string>e</string>
- </tuple>
- </value>
- </item>
- </dictionary>
- </state>
- </object>
- </value>
- </item>
- <item>
- <key> <string>func_defaults</string> </key>
- <value>
- <tuple>
- <none/>
- </tuple>
- </value>
- </item>
- <item>
- <key> <string>id</string> </key>
- <value> <string>InvoiceTransaction_postGenerationActivity</string> </value>
- </item>
- <item>
- <key> <string>warnings</string> </key>
- <value>
- <tuple/>
- </value>
- </item>
- </dictionary>
- </pickle>
- </record>
-</ZopeData>
More information about the Erp5-report
mailing list