Commit 636f9c3e authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting:

* force all Sale documents to use a consistent price currency
* add script to generate the deposit
* add deposit account
  XXX configuration must be reviewed
* add Deposit service to use on the invoice
* deposit service is not taxable
  XXX to check with accountants
* business process: no need to have 2 credit path
* creation causality link between the deposit payment and invoice
* put destination account in the transaction line
  XXX no way currently to support having no destination if the destination_section does not handle accounting
* add alarm slapos_update_delivery_simulation
  Generate invoice from packing list
* generate accounting for resource_use/use/trade/deposit
* add slapos_simulation_interaction_workflow
  Speed up execution of the simulation process by triggering alarms as soon as it is needed
* generate Open Order simulation as soon as it is simulated
parent 65b35871
......@@ -61,9 +61,11 @@
<value>
<object>
<klass>
<global id="1.1" name="DateTime" module="DateTime.DateTime"/>
<global id="1.1" name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global id="1.2" name="DateTime" module="DateTime.DateTime"/>
<global id="1.3" name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
......@@ -84,6 +86,16 @@
<value> <string>This business path is just a template thus disabled by using \'python:False\' in Predicate.\n
For real use, it is required to set an appropriate source (= account) category in Profile.</string> </value>
</item>
<item>
<key> <string>destination_method_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>destination_method_replace_category</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>efficiency</string> </key>
<value> <float>-1.0</float> </value>
......@@ -115,6 +127,8 @@ For real use, it is required to set an appropriate source (= account) category i
<value>
<tuple>
<string>resource_use/use/trade/sale</string>
<string>resource_use/use/trade/tax</string>
<string>resource_use/use/trade/deposit</string>
</tuple>
</value>
</item>
......@@ -124,6 +138,8 @@ For real use, it is required to set an appropriate source (= account) category i
<object>
<klass> <reference id="1.1"/> </klass>
<tuple>
<reference id="1.2"/>
<reference id="1.3"/>
<none/>
</tuple>
<state>
......@@ -149,6 +165,10 @@ For real use, it is required to set an appropriate source (= account) category i
<key> <string>portal_type</string> </key>
<value> <string>Trade Model Path</string> </value>
</item>
<item>
<key> <string>source_method_replace_category</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Trade Model Path" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>modification_date</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>date</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>creation_date</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>date</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>trade_phase/slapos/accounting</string>
<string>trade_date/trade_phase/slapos/invoicing</string>
<string>source/account_module/deposit</string>
</tuple>
</value>
</item>
<item>
<key> <string>creation_date</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global id="1.2" name="DateTime" module="DateTime.DateTime"/>
<global id="1.3" name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1324249200.0</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>TMP-ACCOUNTING-DEPOSIT-CREDIT</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>This business path is just a template thus disabled by using \'python:False\' in Predicate.\n
For real use, it is required to set an appropriate source (= account) category in Profile.</string> </value>
</item>
<item>
<key> <string>destination_method_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>destination_method_replace_category</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>efficiency</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>account_deposit_credit_path</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>7</int> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>resource_use</string>
</tuple>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple>
<string>resource_use/use/trade/deposit</string>
</tuple>
</value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple>
<reference id="1.2"/>
<reference id="1.3"/>
<none/>
</tuple>
<state>
<tuple>
<float>1324249200.0</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>multimembership_criterion_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>payment_end_of_month</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Trade Model Path</string> </value>
</item>
<item>
<key> <string>source_method_replace_category</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Accounting Deposit Credit</string> </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/>
</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_updateSlapOSDeliverySimulation</string> </value>
</item>
<item>
<key> <string>automatic_solve</string> </key>
<value> <int>0</int> </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>slapos_update_delivery_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="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<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>SlapOS Updates Delivery Simulation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Service" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>__translation_dict</string> </key>
<value>
<dictionary>
<item>
<key>
<tuple>
<string>title</string>
<string>fr</string>
</tuple>
</key>
<value>
<tuple>
<string>Deposit</string>
<string>Acompte</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>quantity_unit/unit/piece</string>
<string>use/trade/deposit</string>
</tuple>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>deposit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_deposit</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Service</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Deposit</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</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>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<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>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1008.48056.11297.22237</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1685434526.17</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</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>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1685365491.07</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -31,6 +31,7 @@
<portal_type id="Open Sale Order">
<item>SlapOSAccountingOpenSaleOrderConstraint</item>
<item>SlapOSLedgerConstraint</item>
<item>SlapOSSaleProfileConstraint</item>
</portal_type>
<portal_type id="Open Sale Order Line">
<item>SlapOSAccountingOpenSaleOrderLineConstraint</item>
......@@ -45,16 +46,22 @@
<portal_type id="Sale Invoice Transaction">
<item>SlapOSAccountingSaleInvoiceTransactionConstraint</item>
<item>SlapOSLedgerConstraint</item>
<item>SlapOSSaleProfileConstraint</item>
</portal_type>
<portal_type id="Sale Order">
<item>SlapOSSaleProfileConstraint</item>
</portal_type>
<portal_type id="Sale Packing List">
<item>SlapOSAccountingSalePackingListConstraint</item>
<item>SlapOSLedgerConstraint</item>
<item>SlapOSSaleProfileConstraint</item>
</portal_type>
<portal_type id="Sale Packing List Line">
<item>SlapOSAccountingSalePackingListLineConstraint</item>
</portal_type>
<portal_type id="Sale Trade Condition">
<item>SlapOSAccountingSaleTradeConditionConstraint</item>
<item>SlapOSSaleProfileConstraint</item>
</portal_type>
<portal_type id="Slave Instance">
<item>InstanceAccountingSynchronisation</item>
......
<workflow_chain>
<chain>
<type>Applied Rule</type>
<workflow>slapos_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Cloud Contract</type>
<workflow>edit_workflow, item_workflow</workflow>
......@@ -21,15 +25,19 @@
</chain>
<chain>
<type>Open Sale Order</type>
<workflow>slapos_accounting_interaction_workflow</workflow>
<workflow>slapos_accounting_interaction_workflow, slapos_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Invoice Transaction</type>
<workflow>slapos_accounting_interaction_workflow</workflow>
<workflow>slapos_accounting_interaction_workflow, slapos_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Sale Packing List</type>
<workflow>slapos_accounting_interaction_workflow</workflow>
<workflow>slapos_accounting_interaction_workflow, slapos_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Simulation Movement</type>
<workflow>slapos_simulation_interaction_workflow</workflow>
</chain>
<chain>
<type>Subscription Item Root Simulation Rule</type>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlapOSSaleProfileConstraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Trade Model Path" module="erp5.portal_type"/>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -18,62 +18,33 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>trade_phase/slapos/accounting</string>
<string>trade_date/trade_phase/slapos/invoicing</string>
<string>source/account_module/receivable</string>
<string>destination/account_module/payable</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>accounting_tax2</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
<value> <string>Consider the system do not manage double accounting for now.</string> </value>
</item>
<item>
<key> <string>efficiency</string> </key>
<value> <float>-1.0</float> </value>
<key> <string>expression</string> </key>
<value> <string>python: context.getDestinationSectionValue().getPriceCurrency(\'\') == \'\'</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>accounting_tax2</string> </value>
<value> <string>destination_section_price_currency_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>8</int> </value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>resource_use</string>
</tuple>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple>
<string>resource_use/use/trade/tax</string>
</tuple>
<tuple/>
</value>
</item>
<item>
<key> <string>payment_end_of_month</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Trade Model Path</string> </value>
<key> <string>message_expression_false</string> </key>
<value> <string>Price Currency must be defined on the Destination Section</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
......@@ -88,8 +59,8 @@
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>accounting_tax2</string> </value>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.hasDestinationSection(portal_type=\'Organisation\')</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Consider the system use no currency convertion. If a source_section is used, it MUST define the same currency</string> </value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.getPriceCurrency() == context.getSourceSectionValue().getPriceCurrency()</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>source_section_price_currency_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Price Currency must be the one used on the Source Section</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.hasSourceSection()</string> </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/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
'''
Script to be used as API whenever we want to get an account for a
specific use. Returns the Account object
'''
id = {
'asset_receivable_subscriber': 'receivable',
'asset_deposit_subscriber': 'deposit',
'collection': 'payment_to_encash',
'payable': 'payable'
}[use]
account, = context.getPortalObject().portal_catalog(
portal_type='Account',
id=id,
validation_state='validated',
limit=2,
)
return account.getObject()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>use</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getAccountForUse</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from DateTime import DateTime
portal = context.getPortalObject()
payment_transaction = context
payment_transaction.stop()
start_date = DateTime()
stop_date = None
resource_value = portal.restrictedTraverse('service_module/slapos_deposit')
quantity_unit_value = resource_value.getQuantityUnitValue()
order_portal_type = 'Sale Packing List'
order_line_portal_type = 'Sale Packing List Line'
activate_kw = None
#######################################################
# Open Sale Order
#raise NotImplementedError('Fix dates')
open_sale_order = portal.getDefaultModule(portal_type=order_portal_type).newContent(
portal_type=order_portal_type,
start_date=start_date,
stop_date=stop_date,
specialise_value=payment_transaction.getSpecialiseValue(),
source_value=payment_transaction.getSourceValue(),
source_section_value=payment_transaction.getSourceSectionValue(),
source_decision_value=payment_transaction.getSourceDecisionValue(),
source_project_value=payment_transaction.getSourceProjectValue(),
destination_value=payment_transaction.getDestinationValue(),
destination_section_value=payment_transaction.getDestinationSectionValue(),
destination_decision_value=payment_transaction.getDestinationDecisionValue(),
destination_project_value=payment_transaction.getDestinationProjectValue(),
ledger_value=portal.portal_categories.ledger.automated,
causality_value=payment_transaction,
price_currency_value=payment_transaction.getResourceValue(),
activate_kw=activate_kw
)
open_sale_order.newContent(
portal_type=order_line_portal_type,
resource_value=resource_value,
quantity_unit_value=quantity_unit_value,
base_contribution_list=resource_value.getBaseContributionList(),
use=resource_value.getUse(),
quantity=1,
#price=-payment_transaction.getTotalPrice(),
price=-payment_transaction.PaymentTransaction_getTotalPayablePrice(),
activate_kw=activate_kw
)
open_sale_order.confirm()
open_sale_order.stop()
open_sale_order.deliver()
return open_sale_order
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaymentTransaction_acceptDepositPayment</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from DateTime import DateTime
from Products.ERP5Type.Message import translateString
portal = context.getPortalObject()
######################################################
# Find Sale Trade Condition
source_section = context
# Create a temp Sale Order to calculate the real price and find the trade condition
now = DateTime()
module = portal.portal_trash
tmp_sale_order = module.newContent(
portal_type='Sale Order',
temp_object=True,
start_date=now,
destination_value=source_section,
destination_section_value=source_section,
destination_decision_value=source_section,
ledger_value=portal.portal_categories.ledger.automated,
price_currency=currency_relative_url
)
tmp_sale_order.SaleOrder_applySaleTradeCondition(batch_mode=1, force=1)
if tmp_sale_order.getSpecialise(None) is None:
raise AssertionError('Can not find a trade condition to generate the Payment Transaction')
if currency_relative_url != tmp_sale_order.getPriceCurrency():
raise AssertionError('Unexpected different currency: %s %s' % (currency_relative_url, tmp_sale_order.getPriceCurrency()))
# If no accounting is needed, no need to check the price
if (tmp_sale_order.getSourceSection(None) == tmp_sale_order.getDestinationSection(None)) or \
(tmp_sale_order.getSourceSection(None) is None):
raise AssertionError('The trade condition does not generate accounting: %s' % tmp_sale_order.getSpecialise())
#######################################################
payment_transaction = portal.accounting_module.newContent(
title="reservation payment",
portal_type="Payment Transaction",
start_date=now,
stop_date=now,
specialise_value=tmp_sale_order.getSpecialiseValue(),
source_value=tmp_sale_order.getSourceValue(),
source_section_value=tmp_sale_order.getSourceSectionValue(),
source_decision_value=tmp_sale_order.getSourceDecisionValue(),
source_project_value=tmp_sale_order.getSourceProjectValue(),
destination_value=tmp_sale_order.getDestinationValue(),
destination_section_value=tmp_sale_order.getDestinationSectionValue(),
destination_decision_value=tmp_sale_order.getDestinationDecisionValue(),
destination_project_value=tmp_sale_order.getDestinationProjectValue(),
ledger_value=portal.portal_categories.ledger.automated,
resource_value=tmp_sale_order.getPriceCurrencyValue(),
created_by_builder=1, # XXX this prevent init script from creating lines.
activate_kw={'tag':'%s_init' % context.getRelativeUrl()}
)
getAccountForUse = context.Base_getAccountForUse
# receivable
payment_transaction.newContent(
id='receivable',
portal_type='Accounting Transaction Line',
quantity=price,
source_value=getAccountForUse('asset_receivable_subscriber'),
destination_value=getAccountForUse('payable')
)
# bank
collection_account = getAccountForUse('collection')
payment_transaction.newContent(
id='bank',
portal_type='Accounting Transaction Line',
quantity=-price,
source_value=collection_account,
destination_value=collection_account
)
if len(payment_transaction.checkConsistency()) != 0:
raise AssertionError(payment_transaction.checkConsistency()[0])
#tag = '%s_update' % context.getDestinationReference()
comment = translateString("Deposit payment.")
payment_transaction.PaymentTransaction_start(comment=comment)
return payment_transaction
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>price, currency_relative_url, batch=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Person_addDepositPayment</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -5,14 +5,18 @@ if specialise is None or specialise.getSpecialiseValue() is None:
return True
amount_list = specialise.getAggregatedAmountList(context)
if len(amount_list) < 1:
return False
precision = context.getPriceCurrencyValue().getQuantityPrecision()
amount = amount_list[0]
total_price = amount.getTotalPrice()
if len(amount_list) == 1:
# XXX why only one amount is expected?
amount = amount_list[0]
total_price = amount.getTotalPrice()
elif len(amount_list) == 0:
# Not all service will generate tax (deposit)
total_price = 0
else:
return False
invoice_tax = 0.
for line in context.getMovementList(context.getPortalInvoiceMovementTypeList()):
......
from Products.ERP5Type.Cache import CachingMethod
portal = context.getPortalObject()
def getPriceAndVAT():
assert date is not None
temp_sale_order = portal.sale_order_module.newContent(
id=str(DateTime().timeTime()), # XXX: workaround for an obscure transactional cache (?) bug
temp_object=True,
portal_type='Sale Order',
start_date=date,
)
temp_sale_order.Order_applyTradeCondition(context)
temp_sale_order_line = temp_sale_order.newContent(
id=str(DateTime().timeTime()), # XXX: workaround for an obscure transactional cache (?) bug
portal_type='Sale Order Line',
resource_value=resource_value,
# XXX Try without variation for now
quantity=quantity,
price=price
)
temp_sale_order_line.setBaseContributionList(resource_value.getBaseContributionList())
amount_list = temp_sale_order_line.getAggregatedAmountList(rounding=False)
if len(amount_list) == 0:
raise ValueError(
'No amount generated for resource %s with Sale Trade Condition %s' % (
resource_value.getPath(),
context.getPath(),
)
)
total_price = temp_sale_order_line.getTotalPrice() or 0.0
# XXX does not work if quantity === total_price
amount = [amount for amount in amount_list if amount.getQuantity() == total_price][0]
return price, amount.getPrice()
cache_index = 0#portal.sale_supply_module.getIntIndex(0)
return CachingMethod(
getPriceAndVAT,
id=(script.id, cache_index, context.getRelativeUrl(), resource_value.getRelativeUrl(), date.strftime('%Y%m%d'), quantity),
cache_factory='erp5_content_long',
)()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>date, resource_value, quantity, price</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleTradeCondition_getPriceAndVAT</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal = context.getPortalObject()
kw = {}
select_dict= {'causality__related__uid': None}
kw.update(
portal_type='Sale Packing List',
ledger__uid=portal.portal_categories.ledger.automated.getUid(),
# This is an optimisation to help mariadb selecting a better index
simulation_state=['delivered'],
left_join_list=select_dict.keys(),
causality__related__uid=None
)
portal.portal_catalog.searchAndActivate(
method_id='updateSimulation',
packet_size=1, # Separate calls to many transactions
method_kw={'expand_root': 1},
activate_kw={'tag': tag},
**kw
)
# register activity on alarm object waiting for own tag in order to have only one alarm
# running in same 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>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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_updateSlapOSDeliverySimulation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -23,6 +23,14 @@ if invoice.getCausality(None) is None:
causality_list.append(causality)
invoice.setCausalityList(causality_list)
# Link the Invoice to the original Deposit payment
# this allow the invoice and payment to be automatilly grouped (lettering)
if invoice.getCausality(None) is not None:
new_causality = invoice.getCausalityValue()
original_payment = new_causality.getCausalityValue(None, portal_type="Payment Transaction")
if original_payment is not None:
original_payment.setCausalityList(original_payment.getCausalityList() + [invoice.getRelativeUrl()])
comment = translateString('Initialised by Delivery Builder.')
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Interaction Workflow" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_simulation_interaction_workflow</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>slapos simulation interaction workflow</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</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>after_script/portal_workflow/slapos_simulation_interaction_workflow/script_Base_triggerSlaposManageBuildingCalculatingDelivery</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Check divergency of a delivery after it has been updated</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_Delivery_calculate</string> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<tuple>
<string>Sale Invoice Transaction</string>
<string>Sale Packing List</string>
</tuple>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
<tuple>
<string>startBuilding</string>
<string>calculate</string>
</tuple>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</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>after_script/portal_workflow/slapos_simulation_interaction_workflow/script_Base_triggerUpdateOpenOrderSimulation</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Create the Open Order related simulation as soon as the Order is validated</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_OpenSaleOrder_validate</string> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<tuple>
<string>Open Sale Order</string>
</tuple>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
<tuple>
<string>validate</string>
</tuple>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</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>after_script/portal_workflow/slapos_simulation_interaction_workflow/script_Base_triggerSlaposStopConfirmedAggregatedSaleInvoiceTransaction</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Try to close the Invoice when it is resolved</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_SaleInvoiceTransaction_solveDivergence</string> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<tuple>
<string>Sale Invoice Transaction</string>
</tuple>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
<tuple>
<string>converge</string>
</tuple>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</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>after_script/portal_workflow/slapos_simulation_interaction_workflow/script_Base_triggerSlaposUpdateDeliverySimulation</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Create the Simulation tree of a manually created Sale Packing List</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_SalePackingList_deliver</string> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<tuple>
<string>Sale Packing List</string>
</tuple>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
<tuple>
<string>deliver</string>
</tuple>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</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>after_script/portal_workflow/slapos_simulation_interaction_workflow/script_Base_triggerSlaposTriggerBuild</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Try to build a newly Simulation Movement as soon as it is created</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_SimulationMovement_afterAdd</string> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<tuple>
<string>Simulation Movement</string>
</tuple>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
<tuple>
<string>manage_afterAdd</string>
<string>manage_afterClone</string>
</tuple>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</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>description</string> </key>
<value> <string>Expand just build Simulation Movement\n
\n
_setDelivery\n
\n
XXX seems no needed</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_SimulationMovement_setDelivery</string> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<tuple>
<string>Simulation Movement</string>
</tuple>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
if alarm.getParentValue().isSubscribed() and not alarm.isActive() and alarm.isEnabled():
alarm.activate(queue='SQLQueue', **activate_kw).activeSense()
<?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>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>alarm, activate_kw</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Alarm_safeTrigger</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
base = state_change['object']
portal = base.getPortalObject()
tag = script.id
base.reindexObject(activate_kw={'tag': tag})
context.Alarm_safeTrigger(portal.portal_alarms.slapos_manage_building_calculating_delivery, {'after_tag': tag})
<?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>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Base_triggerSlaposManageBuildingCalculatingDelivery</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
base = state_change['object']
portal = base.getPortalObject()
tag = script.id
base.reindexObject(activate_kw={'tag': tag})
context.Alarm_safeTrigger(portal.portal_alarms.slapos_stop_confirmed_aggregated_sale_invoice_transaction, {'after_tag': tag})
<?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>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Base_triggerSlaposStopConfirmedAggregatedSaleInvoiceTransaction</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
base = state_change['object']
portal = base.getPortalObject()
tag = script.id
base.reindexObject(activate_kw={'tag': tag})
context.Alarm_safeTrigger(portal.portal_alarms.slapos_trigger_build, {'after_tag': tag})
<?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>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Base_triggerSlaposTriggerBuild</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
base = state_change['object']
portal = base.getPortalObject()
tag = script.id
base.reindexObject(activate_kw={'tag': tag})
context.Alarm_safeTrigger(portal.portal_alarms.slapos_update_delivery_simulation, {'after_tag': tag})
<?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>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Base_triggerSlaposUpdateDeliverySimulation</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
base = state_change['object']
portal = base.getPortalObject()
tag = script.id
base.reindexObject(activate_kw={'tag': tag})
context.Alarm_safeTrigger(portal.portal_alarms.update_open_order_simulation, {'after_tag': tag})
<?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>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Base_triggerUpdateOpenOrderSimulation</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -12,4 +12,5 @@ currency_module/EUR
quantity_unit_conversion_module/slapos_time_month
quantity_unit_conversion_module/slapos_time_month/**
service_module/slapos_compute_node_subscription
service_module/slapos_deposit
service_module/slapos_virtual_master_subscription
\ No newline at end of file
......@@ -38,6 +38,7 @@ service_module/cpu_load_percent
service_module/disk_used
service_module/memory_used
service_module/slapos_account_validation
service_module/slapos_deposit
service_module/slapos_instance_cleanup
service_module/slapos_instance_hosting
service_module/slapos_instance_setup
......
account_module/bank
account_module/capital
account_module/coll_vat
account_module/deposit
account_module/equipments
account_module/inventories
account_module/payable
......@@ -24,6 +25,7 @@ service_module/cpu_load_percent
service_module/disk_used
service_module/memory_used
service_module/slapos_account_validation
service_module/slapos_deposit
service_module/slapos_discount
service_module/slapos_instance_cleanup
service_module/slapos_instance_hosting
......
account_module/bank
account_module/capital
account_module/coll_vat
account_module/deposit
account_module/equipments
account_module/inventories
account_module/payable
......@@ -24,6 +25,7 @@ portal_alarms/slapos_request_update_instance_tree_open_sale_order
portal_alarms/slapos_start_confirmed_aggregated_subscription_sale_packing_list
portal_alarms/slapos_stop_confirmed_aggregated_sale_invoice_transaction
portal_alarms/slapos_trigger_build
portal_alarms/slapos_update_delivery_simulation
portal_alarms/slapos_update_open_sale_order_period
portal_categories/trade_phase/slapos
portal_categories/trade_phase/slapos/**
......@@ -64,6 +66,7 @@ service_module/disk_used
service_module/memory_used
service_module/slapos_account_validation
service_module/slapos_compute_node_subscription
service_module/slapos_deposit
service_module/slapos_discount
service_module/slapos_instance_cleanup
service_module/slapos_instance_hosting
......
......@@ -14,15 +14,20 @@ Internal Invoice Transaction | SlapOSVirtualMasterSourceProjectConstraint
Open Sale Order Line | SlapOSAccountingOpenSaleOrderLineConstraint
Open Sale Order | SlapOSAccountingOpenSaleOrderConstraint
Open Sale Order | SlapOSLedgerConstraint
Open Sale Order | SlapOSSaleProfileConstraint
Payment Transaction | SlapOSLedgerConstraint
Purchase Invoice Transaction | SlapOSLedgerConstraint
Purchase Invoice Transaction | SlapOSVirtualMasterSourceProjectConstraint
Sale Invoice Transaction | SlapOSAccountingSaleInvoiceTransactionConstraint
Sale Invoice Transaction | SlapOSLedgerConstraint
Sale Invoice Transaction | SlapOSSaleProfileConstraint
Sale Order | SlapOSSaleProfileConstraint
Sale Packing List Line | SlapOSAccountingSalePackingListLineConstraint
Sale Packing List | SlapOSAccountingSalePackingListConstraint
Sale Packing List | SlapOSLedgerConstraint
Sale Packing List | SlapOSSaleProfileConstraint
Sale Trade Condition | SlapOSAccountingSaleTradeConditionConstraint
Sale Trade Condition | SlapOSSaleProfileConstraint
Slave Instance | InstanceAccountingSynchronisation
Software Instance | InstanceAccountingSynchronisation
User Consumption HTML File | SortIndex
\ No newline at end of file
Applied Rule | slapos_simulation_interaction_workflow
Cloud Contract Line | edit_workflow
Cloud Contract | edit_workflow
Cloud Contract | item_workflow
......@@ -8,8 +9,12 @@ Hosting Subscription | slapos_accounting_interaction_workflow
Instance Tree | slapos_accounting_interaction_workflow
Instance Tree | slapos_api_invoicing_workflow
Open Sale Order | slapos_accounting_interaction_workflow
Open Sale Order | slapos_simulation_interaction_workflow
Sale Invoice Transaction | slapos_accounting_interaction_workflow
Sale Invoice Transaction | slapos_simulation_interaction_workflow
Sale Packing List | slapos_accounting_interaction_workflow
Sale Packing List | slapos_simulation_interaction_workflow
Simulation Movement | slapos_simulation_interaction_workflow
Subscription Item Root Simulation Rule | edit_workflow
Subscription Item Root Simulation Rule | rule_validation_workflow
User Consumption HTML File | document_conversion_interaction_workflow
......
InstanceAccountingSynchronisation
SlapOSLedgerConstraint
SlapOSAccountingOpenSaleOrderLineConstraint
SlapOSAccountingOpenSaleOrderConstraint
SlapOSAccountingHostingSubscriptionConstraint
SlapOSAccountingSaleTradeConditionConstraint
SlapOSAccountingOpenSaleOrderConstraint
SlapOSAccountingOpenSaleOrderLineConstraint
SlapOSAccountingSaleInvoiceTransactionConstraint
SlapOSAccountingSalePackingListConstraint
SlapOSAccountingSalePackingListLineConstraint
SlapOSAccountingSaleTradeConditionConstraint
SlapOSAccountingSystemPreference
SlapOSCloudContractAccounting
SlapOSCloudContractLineAccounting
SlapOSLedgerConstraint
SlapOSSaleProfileConstraint
\ No newline at end of file
slapos_accounting_interaction_workflow
slapos_api_invoicing_workflow
slapos_simulation_interaction_workflow
\ 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