From bdf777c459587bc3278a9c4f2dffdb5d6b4d6b7c Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Tue, 30 Oct 2007 01:14:32 +0000
Subject: [PATCH] 2007-10-30 yo * Add pricing_interaction_workflow.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17271 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../pricing_interaction_workflow.xml          |  64 +++++++
 .../interactions.xml                          |  40 +++++
 .../interactions/Movement_getPrice.xml        |  96 +++++++++++
 .../pricing_interaction_workflow/scripts.xml  |  40 +++++
 .../scripts/Movement_setPrice.xml             | 159 ++++++++++++++++++
 .../variables.xml                             |  34 ++++
 .../worklists.xml                             |  34 ++++
 .../ERP5/bootstrap/erp5_core/bt/change_log    |   3 +
 product/ERP5/bootstrap/erp5_core/bt/revision  |   2 +-
 .../erp5_core/bt/template_workflow_id_list    |   1 +
 10 files changed, 472 insertions(+), 1 deletion(-)
 create mode 100644 product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow.xml
 create mode 100644 product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/interactions.xml
 create mode 100644 product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/interactions/Movement_getPrice.xml
 create mode 100644 product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/scripts.xml
 create mode 100644 product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/scripts/Movement_setPrice.xml
 create mode 100644 product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/variables.xml
 create mode 100644 product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/worklists.xml

diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow.xml
new file mode 100644
index 0000000000..0fb496678e
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5.InteractionWorkflow</string>
+          <string>InteractionWorkflowDefinition</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>creation_guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>This workflow defines an interaction to set price automatically when getPrice is called, if not set yet.</string> </value>
+        </item>
+        <item>
+            <key> <string>groups</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>pricing_interaction_workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>manager_bypass</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Pricing Interaction Workflow</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/interactions.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/interactions.xml
new file mode 100644
index 0000000000..7d8c51003b
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/interactions.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5.Interaction</string>
+          <string>Interaction</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mapping</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>interactions</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/interactions/Movement_getPrice.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/interactions/Movement_getPrice.xml
new file mode 100644
index 0000000000..55dac1bf62
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/interactions/Movement_getPrice.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5.Interaction</string>
+          <string>InteractionDefinition</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>actbox_category</string> </key>
+            <value> <string>workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>activate_script_name</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value>
+              <list>
+                <string>Movement_setPrice</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Set price automatically when getPrice is called, if not set yet.</string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Movement_getPrice</string> </value>
+        </item>
+        <item>
+            <key> <string>method_id</string> </key>
+            <value>
+              <list>
+                <string>getPrice</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>once_per_transaction</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>portal_type_filter</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>2</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/scripts.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/scripts.xml
new file mode 100644
index 0000000000..01ba35bf25
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/scripts.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.DCWorkflow.Scripts</string>
+          <string>Scripts</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mapping</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>scripts</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/scripts/Movement_setPrice.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/scripts/Movement_setPrice.xml
new file mode 100644
index 0000000000..1458353be4
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/scripts/Movement_setPrice.xml
@@ -0,0 +1,159 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>movement = state_change[\'object\']\n
+if not movement.hasPrice():\n
+  price = state_change[\'kwargs\'][\'workflow_method_result\']\n
+  if price is not None:\n
+    movement.setPrice(price)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>state_change</string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>state_change</string>
+                            <string>_getitem_</string>
+                            <string>movement</string>
+                            <string>_getattr_</string>
+                            <string>price</string>
+                            <string>None</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Movement_setPrice</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/variables.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/variables.xml
new file mode 100644
index 0000000000..db67387d4e
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/variables.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.DCWorkflow.Variables</string>
+          <string>Variables</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mapping</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>variables</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/worklists.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/worklists.xml
new file mode 100644
index 0000000000..f4c2789633
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/pricing_interaction_workflow/worklists.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.DCWorkflow.Worklists</string>
+          <string>Worklists</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mapping</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>worklists</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_core/bt/change_log b/product/ERP5/bootstrap/erp5_core/bt/change_log
index f9b62b3157..dcc446d0dc 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/change_log
+++ b/product/ERP5/bootstrap/erp5_core/bt/change_log
@@ -1,3 +1,6 @@
+2007-10-30 yo
+* Add pricing_interaction_workflow.
+
 2007-10-29 jerome
 * Add field libraries for report and dialogs. Increase version to 1.0rc13
 
diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision
index 64ae959863..dd35c6b71f 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/revision
+++ b/product/ERP5/bootstrap/erp5_core/bt/revision
@@ -1 +1 @@
-546
\ No newline at end of file
+548
\ No newline at end of file
diff --git a/product/ERP5/bootstrap/erp5_core/bt/template_workflow_id_list b/product/ERP5/bootstrap/erp5_core/bt/template_workflow_id_list
index 2604a58cd4..e0c270c265 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/template_workflow_id_list
+++ b/product/ERP5/bootstrap/erp5_core/bt/template_workflow_id_list
@@ -7,6 +7,7 @@ edit_workflow
 order_movement_simulation_interaction_workflow
 order_simulation_interaction_workflow
 preference_workflow
+pricing_interaction_workflow
 rule_interaction_workflow
 simulation_movement_causality_interaction_workflow
 validation_workflow
\ No newline at end of file
-- 
2.30.9