From c22f3209940ec4add24c2fea4f8e098fca059c6d Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Fri, 16 Dec 2011 14:55:50 +0200
Subject: [PATCH] Use trade condition.

---
 .../testHowToSaleOrder.xml                    |   2 +-
 .../sale_trade_condition_module/1.xml         | 143 ++++++++++++++++++
 .../Zuite_setUpSaleOrderTest.xml              |   6 +
 bt5/erp5_user_tutorial_ui_test/bt/revision    |   2 +-
 .../bt/template_path_list                     |   4 +-
 5 files changed, 154 insertions(+), 3 deletions(-)
 create mode 100644 bt5/erp5_user_tutorial_ui_test/PathTemplateItem/sale_trade_condition_module/1.xml

diff --git a/bt5/erp5_user_tutorial_ui_test/PathTemplateItem/portal_tests/user_tutorial_zuite/testHowToSaleOrder.xml b/bt5/erp5_user_tutorial_ui_test/PathTemplateItem/portal_tests/user_tutorial_zuite/testHowToSaleOrder.xml
index 5cd7335adb..f6a5909505 100644
--- a/bt5/erp5_user_tutorial_ui_test/PathTemplateItem/portal_tests/user_tutorial_zuite/testHowToSaleOrder.xml
+++ b/bt5/erp5_user_tutorial_ui_test/PathTemplateItem/portal_tests/user_tutorial_zuite/testHowToSaleOrder.xml
@@ -123,7 +123,7 @@
 <tr>\n
   <td>type</td>\n
   <td>//input[@name="field_my_specialise_title"]</td>\n
-  <td>erp5_default_business_process</td>\n
+  <td>Default Sale Order Trade Condition</td>\n
 </tr>\n
 <tr>\n
   <td>type</td>\n
diff --git a/bt5/erp5_user_tutorial_ui_test/PathTemplateItem/sale_trade_condition_module/1.xml b/bt5/erp5_user_tutorial_ui_test/PathTemplateItem/sale_trade_condition_module/1.xml
new file mode 100644
index 0000000000..1ab4401d82
--- /dev/null
+++ b/bt5/erp5_user_tutorial_ui_test/PathTemplateItem/sale_trade_condition_module/1.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Sale Trade Condition" 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>_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>categories</string> </key>
+            <value>
+              <tuple>
+                <string>specialise/business_process_module/erp5_default_business_process</string>
+                <string>price_currency/currency_module/1</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>comment</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_reference</string> </key>
+            <value> <string>default-sale-order-trade-condition</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>1</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Sale Trade Condition</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Default Sale Order Trade Condition</string> </value>
+        </item>
+        <item>
+            <key> <string>version</string> </key>
+            <value>
+              <none/>
+            </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>
diff --git a/bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_setUpSaleOrderTest.xml b/bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_setUpSaleOrderTest.xml
index fa049a459b..a125f50812 100644
--- a/bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_setUpSaleOrderTest.xml
+++ b/bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_setUpSaleOrderTest.xml
@@ -63,6 +63,12 @@ business_process = context.portal_catalog.getResultValue(portal_type=\'Business
 if isTransitionPossible(business_process, \'validate\'):\n
   business_process.validate()\n
 \n
+# XXX: add default sale order trade condition\n
+sale_order_trade_condition = context.portal_catalog.getResultValue(portal_type=\'Sale Trade Condition\',\n
+                                                                  reference=\'default-sale-order-trade-condition\')\n
+if isTransitionPossible(sale_order_trade_condition, \'validate\'):\n
+  sale_order_trade_condition.validate()\n
+\n
 # check if there is already the euro curency on the instance\n
 currency = context.portal_catalog.getResultValue(portal_type=\'Currency\',\n
                                                  title=howto_dict[\'sale_howto_currency_title\'])\n
diff --git a/bt5/erp5_user_tutorial_ui_test/bt/revision b/bt5/erp5_user_tutorial_ui_test/bt/revision
index eb6fa5affc..fc0b67d079 100644
--- a/bt5/erp5_user_tutorial_ui_test/bt/revision
+++ b/bt5/erp5_user_tutorial_ui_test/bt/revision
@@ -1 +1 @@
-773
\ No newline at end of file
+774
\ No newline at end of file
diff --git a/bt5/erp5_user_tutorial_ui_test/bt/template_path_list b/bt5/erp5_user_tutorial_ui_test/bt/template_path_list
index 6901164802..ce666a6a33 100644
--- a/bt5/erp5_user_tutorial_ui_test/bt/template_path_list
+++ b/bt5/erp5_user_tutorial_ui_test/bt/template_path_list
@@ -25,4 +25,6 @@ portal_categories/region/brazil/**
 portal_categories/role
 portal_categories/role/**
 portal_tests/user_tutorial_zuite
-portal_tests/user_tutorial_zuite/**
\ No newline at end of file
+portal_tests/user_tutorial_zuite/**
+sale_trade_condition_module/1
+sale_trade_condition_module/1/**
\ No newline at end of file
-- 
2.30.9