From 93d51fa6086e0287beeaacb1a57fb00ec22ceec0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 1 Dec 2009 09:42:46 +0000
Subject: [PATCH] Update property translation domain dict everytime we add a
 new property sheet. This fixes test_translated_accessors who was working
 until 30866 because _property_domain_dict was not included in the business
 template.

This fix is only partial, because if property sheet definition change or if new property sheets are added on the class, the domain will not be recalculated.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30953 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../BaseType_setPropertySheetList.xml         |  96 ++++++++++++++
 ...teInitialPropertyTranslationDomainDict.xml | 123 ++++++++++++++++++
 product/ERP5/bootstrap/erp5_core/bt/revision  |   2 +-
 3 files changed, 220 insertions(+), 1 deletion(-)
 create mode 100644 product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/base_type_interaction_workflow/interactions/BaseType_setPropertySheetList.xml
 create mode 100644 product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/base_type_interaction_workflow/scripts/BaseType_updateInitialPropertyTranslationDomainDict.xml

diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/base_type_interaction_workflow/interactions/BaseType_setPropertySheetList.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/base_type_interaction_workflow/interactions/BaseType_setPropertySheetList.xml
new file mode 100644
index 0000000000..8a555231af
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/base_type_interaction_workflow/interactions/BaseType_setPropertySheetList.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <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>BaseType_updateInitialPropertyTranslationDomainDict</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>before_commit_script_name</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>BaseType_setPropertySheetList</string> </value>
+        </item>
+        <item>
+            <key> <string>method_id</string> </key>
+            <value>
+              <list>
+                <string>_setTypePropertySheetList</string>
+                <string>_setPropertySheetList</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>once_per_transaction</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>portal_type_filter</string> </key>
+            <value>
+              <list>
+                <string>Base Type</string>
+              </list>
+            </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/base_type_interaction_workflow/scripts/BaseType_updateInitialPropertyTranslationDomainDict.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/base_type_interaction_workflow/scripts/BaseType_updateInitialPropertyTranslationDomainDict.xml
new file mode 100644
index 0000000000..3f8d80115a
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/base_type_interaction_workflow/scripts/BaseType_updateInitialPropertyTranslationDomainDict.xml
@@ -0,0 +1,123 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>sci[\'object\'].updateInitialPropertyTranslationDomainDict()\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>sci</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>sci</string>
+                            <string>_getattr_</string>
+                            <string>_getitem_</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>BaseType_updateInitialPropertyTranslationDomainDict</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/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision
index 62713742b7..05fd8282c8 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/revision
+++ b/product/ERP5/bootstrap/erp5_core/bt/revision
@@ -1 +1 @@
-1390
\ No newline at end of file
+1392
\ No newline at end of file
-- 
2.30.9