Commit 7bbea43e authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_interaction_drop: Include BT5 for Drop Interactions on simulations

   This originally is a patch on erp5 repository, but moved into a single bt5 for better mantainence.
parent 8965f487
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from erp5.component.document.erp5_version.SubscriptionItem import SubscriptionItem as ERP5SubscriptionItem
class SubscriptionItem(ERP5SubscriptionItem):
def updateExpandableRootSimulation(self):
""" Utility method to help use updateSimulation with SQLDict on activities """
self.updateSimulation(expand_root=1)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>SubscriptionItem</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5_slapos.SubscriptionItem</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5_slapos</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value>
<list>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</list>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="Message" module="Products.ERP5Type.Message"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string>ID is invalid, should be \'${id_prefix}.VERSION.REFERENCE\'</string> </value>
</item>
<item>
<key> <string>domain</string> </key>
<value> <string>erp5_ui</string> </value>
</item>
<item>
<key> <string>mapping</string> </key>
<value>
<dictionary>
<item>
<key> <string>id_prefix</string> </key>
<value> <string>document</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>message</string> </key>
<value> <string>ID is invalid, should be \'${id_prefix}.VERSION.REFERENCE\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Alarm" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_updateOpenOrderSimulation</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>update_open_order_simulation</string> </value>
</item>
<item>
<key> <string>periodicity_day_frequency</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_minute</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_minute_frequency</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>periodicity_month</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_month_day</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_start_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>0.0</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>periodicity_week</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Alarm</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Updates Open Orders Simulation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</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>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Delivery_localBuild</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=deliver_action</string> </value>
</item>
<item>
<key> <string>action_name</string> </key>
<value> <string>Definitively Close Transaction</string> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>before_script/portal_workflow/accounting_workflow/script_validateTransactionLines</string>
<string>after_script/portal_workflow/accounting_workflow/transition_deliver</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Mark transaction that belongs to "closed" accounting periods</string> </value>
</item>
<item>
<key> <string>guard_expression</string> </key>
<value> <string>python: here.getProperty(\'causality_state\', \'default\') == \'solved\'</string> </value>
</item>
<item>
<key> <string>guard_group</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>guard_role</string> </key>
<value>
<tuple>
<string>Assignor</string>
</tuple>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_deliver_action</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Transition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Definitively Close Transaction Action</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Interaction Workflow Interaction" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>before_commit_script/portal_workflow/simulation_movement_causality_interaction_workflow/script_SimulationMovement_calculateCausalityState</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_calculate_causality</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Interaction Workflow Interaction</string> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type_group_filter</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
<tuple>
<string>_set(?!LastId$|Ob$|Object$|Delivery$|DeliveryValue$|CategoryList$)</string>
</tuple>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<workflow_chain>
<chain>
<type>Accounting Transaction</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Accounting Transaction Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Amortisation Transaction</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Amortisation Transaction Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Container Cell</type>
<workflow>-container_interaction_workflow</workflow>
</chain>
<chain>
<type>Container Line</type>
<workflow>-container_interaction_workflow</workflow>
</chain>
<chain>
<type>Delivery Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Internal Order</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Internal Order Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Internal Order Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Internal Packing List</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Internal Packing List Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Internal Packing List Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Invoice Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Invoice Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Open Internal Order</type>
<workflow>-open_order_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Open Internal Order Cell</type>
<workflow>-open_order_path_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Open Internal Order Line</type>
<workflow>-open_order_path_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Open Purchase Order</type>
<workflow>-open_order_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Open Purchase Order Cell</type>
<workflow>-open_order_path_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Open Purchase Order Line</type>
<workflow>-open_order_path_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Open Sale Order</type>
<workflow>-open_order_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Open Sale Order Cell</type>
<workflow>-open_order_path_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Open Sale Order Line</type>
<workflow>-open_order_path_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Payment Transaction</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Purchase Invoice Transaction</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Purchase Invoice Transaction Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Purchase Order</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Purchase Order Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Purchase Order Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Purchase Packing List</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Purchase Packing List Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Purchase Packing List Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Purchase Order</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Purchase Order Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Purchase Order Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Purchase Packing List</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Purchase Packing List Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Purchase Packing List Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Sale Order</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Sale Order Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Sale Order Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Sale Packing List</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Sale Packing List Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Returned Sale Packing List Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Invoice Transaction</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Invoice Transaction Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Order</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Order Cell</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Order Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Packing List</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Packing List Cell</type>
<workflow>-container_interaction_workflow, -delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Packing List Line</type>
<workflow>-container_interaction_workflow, -delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Task</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Task Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Task Report</type>
<workflow>-delivery_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Task Report Line</type>
<workflow>-delivery_movement_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Trade Model Line</type>
<workflow>-trade_model_line_interaction_workflow</workflow>
</chain>
<chain>
<type>Transformation</type>
<workflow>-transformation_interaction_workflow</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>99.9</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_interaction_drop</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
kw = {}
if params is None:
params = {}
last_active_process = context.getLastActiveProcess()
if not params.get('full', False) and last_active_process is not None:
# fetch only objects modified since last alarm run
kw['indexation_timestamp'] = '>= %s' % last_active_process.getStartDate().ISO()
# register active process in order to have "windows" of last indexed objects
context.newActiveProcess().getRelativeUrl()
portal = context.getPortalObject()
kw['portal_type'] = portal.getPortalOpenOrderTypeList()
kw['children_portal_type'] = [ i + " Line" for i in portal.getPortalOpenOrderTypeList()]
portal.portal_catalog.searchAndActivate(
method_id='OpenOrder_updateSimulation',
packet_size=1,
activate_kw={'tag':tag},
**kw
)
# make alarm run once at time
context.activate(after_tag=tag).getId()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>_params</string> </key>
<value> <string>tag, fixit, params</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_updateOpenOrderSimulation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""This script is called on the Invoice after the delivery builder has created
the new Invoice.
"""
if related_simulation_movement_path_list is None:
raise RuntimeError('related_simulation_movement_path_list is missing. Update ERP5 Product.')
invoice = context
# if installed erp5_simplified_invoicing, set resource from price currency
if not invoice.Invoice_isAdvanced():
if not invoice.getResource():
invoice.setResource(invoice.getPriceCurrency())
related_packing_list = invoice.getDefaultCausalityValue()
related_order = None if related_packing_list is None else \
related_packing_list.getDefaultCausalityValue()
# copy payment conditions from packing list
# if missing, try to copy from order (for compatibility)
if not invoice.contentValues(portal_type='Payment Condition'):
payment_condition_copy_id_list = []
if related_packing_list is not None:
payment_condition_copy_id_list = related_packing_list.contentIds(filter={'portal_type':'Payment Condition'})
if len(payment_condition_copy_id_list) > 0:
clipboard = related_packing_list.manage_copyObjects(ids=payment_condition_copy_id_list)
invoice.manage_pasteObjects(clipboard)
elif related_order is not None:
payment_condition_copy_id_list = related_order.contentIds(
filter={'portal_type':'Payment Condition'})
if len(payment_condition_copy_id_list) > 0:
clipboard = related_order.manage_copyObjects(ids=payment_condition_copy_id_list)
invoice.manage_pasteObjects(clipboard)
# copy title, if not updating a new delivery
if not invoice.hasTitle() and related_packing_list is not None and \
related_packing_list.hasTitle():
invoice.setTitle(related_packing_list.getTitle())
# initialize accounting_workflow to confirmed state
if invoice.getSimulationState() == 'draft':
invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list,
('immediateReindexObject','recursiveImmediateReindexObject')),
tag=confirm_tag).Delivery_confirm()
invoice.startBuilding()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>_params</string> </key>
<value> <string>related_simulation_movement_path_list=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>InvoiceTransaction_postGeneration</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
activate_kw={}
if tag is not None:
activate_kw={'tag': tag}
for path in [context] + context.getCellValueList():
for item in path.getAggregateValueList():
if item.providesIExpandableItem():
applied_rule = item.getCausalityRelatedValue(portal_type='Applied Rule')
if applied_rule is not None:
applied_rule.expand(activate_kw=activate_kw)
else:
item.Delivery_updateAppliedRule(activate_kw=activate_kw)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>_params</string> </key>
<value> <string>tag=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OpenOrderLine_updateSimulation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_accounting
erp5_invoicing
erp5_item
erp5_computer_immobilisation
erp5_software_pdm
slapos_mysql_innodb_catalog
erp5_certificate_authority
erp5_open_trade
erp5_project
\ No newline at end of file
document.erp5_slapos.SubscriptionItem
\ No newline at end of file
portal_alarms/update_open_order_simulation
portal_alarms/update_open_order_simulation/**
portal_workflow/accounting_workflow/script_Delivery_localBuild
portal_workflow/accounting_workflow/transition_deliver_action
portal_workflow/simulation_movement_causality_interaction_workflow/interaction_calculate_causality
\ No newline at end of file
Accounting Transaction Line | -delivery_movement_simulation_interaction_workflow
Accounting Transaction | -delivery_simulation_interaction_workflow
Amortisation Transaction Line | -delivery_movement_simulation_interaction_workflow
Amortisation Transaction | -delivery_simulation_interaction_workflow
Container Cell | -container_interaction_workflow
Container Line | -container_interaction_workflow
Delivery Cell | -delivery_movement_simulation_interaction_workflow
Internal Order Cell | -delivery_movement_simulation_interaction_workflow
Internal Order Line | -delivery_movement_simulation_interaction_workflow
Internal Order | -delivery_simulation_interaction_workflow
Internal Packing List Cell | -delivery_movement_simulation_interaction_workflow
Internal Packing List Line | -delivery_movement_simulation_interaction_workflow
Internal Packing List | -delivery_simulation_interaction_workflow
Invoice Cell | -delivery_movement_simulation_interaction_workflow
Invoice Line | -delivery_movement_simulation_interaction_workflow
Open Internal Order Cell | -open_order_path_simulation_interaction_workflow
Open Internal Order Line | -open_order_path_simulation_interaction_workflow
Open Internal Order | -open_order_simulation_interaction_workflow
Open Purchase Order Cell | -open_order_path_simulation_interaction_workflow
Open Purchase Order Line | -open_order_path_simulation_interaction_workflow
Open Purchase Order | -open_order_simulation_interaction_workflow
Open Sale Order Cell | -open_order_path_simulation_interaction_workflow
Open Sale Order Line | -open_order_path_simulation_interaction_workflow
Open Sale Order | -open_order_simulation_interaction_workflow
Payment Transaction | -delivery_simulation_interaction_workflow
Purchase Invoice Transaction Line | -delivery_movement_simulation_interaction_workflow
Purchase Invoice Transaction | -delivery_simulation_interaction_workflow
Purchase Order Cell | -delivery_movement_simulation_interaction_workflow
Purchase Order Line | -delivery_movement_simulation_interaction_workflow
Purchase Order | -delivery_simulation_interaction_workflow
Purchase Packing List Cell | -delivery_movement_simulation_interaction_workflow
Purchase Packing List Line | -delivery_movement_simulation_interaction_workflow
Purchase Packing List | -delivery_simulation_interaction_workflow
Returned Purchase Order Cell | -delivery_movement_simulation_interaction_workflow
Returned Purchase Order Line | -delivery_movement_simulation_interaction_workflow
Returned Purchase Order | -delivery_simulation_interaction_workflow
Returned Purchase Packing List Cell | -delivery_movement_simulation_interaction_workflow
Returned Purchase Packing List Line | -delivery_movement_simulation_interaction_workflow
Returned Purchase Packing List | -delivery_simulation_interaction_workflow
Returned Sale Order Cell | -delivery_movement_simulation_interaction_workflow
Returned Sale Order Line | -delivery_movement_simulation_interaction_workflow
Returned Sale Order | -delivery_simulation_interaction_workflow
Returned Sale Packing List Cell | -delivery_movement_simulation_interaction_workflow
Returned Sale Packing List Line | -delivery_movement_simulation_interaction_workflow
Returned Sale Packing List | -delivery_simulation_interaction_workflow
Sale Invoice Transaction Line | -delivery_movement_simulation_interaction_workflow
Sale Invoice Transaction | -delivery_simulation_interaction_workflow
Sale Order Cell | -delivery_movement_simulation_interaction_workflow
Sale Order Line | -delivery_movement_simulation_interaction_workflow
Sale Order | -delivery_simulation_interaction_workflow
Sale Packing List Cell | -container_interaction_workflow
Sale Packing List Cell | -delivery_movement_simulation_interaction_workflow
Sale Packing List Line | -container_interaction_workflow
Sale Packing List Line | -delivery_movement_simulation_interaction_workflow
Sale Packing List | -delivery_simulation_interaction_workflow
Task Line | -delivery_movement_simulation_interaction_workflow
Task Report Line | -delivery_movement_simulation_interaction_workflow
Task Report | -delivery_simulation_interaction_workflow
Task | -delivery_simulation_interaction_workflow
Trade Model Line | -trade_model_line_interaction_workflow
Transformation | -transformation_interaction_workflow
\ No newline at end of file
erp5_interaction_drop
\ No newline at end of file
erp5_interaction_drop
\ 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