[Erp5-report] r40005 jm - in /erp5/trunk: bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_...

nobody at svn.erp5.org nobody at svn.erp5.org
Sun Nov 7 04:12:23 CET 2010


Author: jm
Date: Sun Nov  7 04:12:22 2010
New Revision: 40005

URL: http://svn.erp5.org?rev=40005&view=rev
Log:
Fix Delivery_updateAppliedRule on Zope 2.12

Modified:
    erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_updateAppliedRule.xml
    erp5/trunk/bt5/erp5_base/bt/revision
    erp5/trunk/products/ERP5/Document/Delivery.py
    erp5/trunk/products/ERP5/Document/SubscriptionItem.py
    erp5/trunk/products/ERP5Type/Errors.py

Modified: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_updateAppliedRule.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_updateAppliedRule.xml?rev=40005&r1=40004&r2=40005&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_updateAppliedRule.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_updateAppliedRule.xml [utf8] Sun Nov  7 04:12:22 2010
@@ -50,7 +50,9 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>delivery = context\n
+            <value> <string>from Products.ERP5Type.Errors import SimulationError\n
+\n
+delivery = context\n
 delivery_type = context.getPortalType()\n
 \n
 # XXX The following dict is only for backward compatibility.\n
@@ -80,7 +82,7 @@ applied_rule_dict = {\n
 \n
 try:\n
   applied_rule = delivery.getRuleReference()\n
-except \'SimulationError\':\n
+except SimulationError:\n
   marker = []\n
   applied_rule = applied_rule_dict.get(delivery_type, marker)\n
   if applied_rule is marker:\n
@@ -133,6 +135,8 @@ elif applied_rule:\n
                           <tuple>
                             <string>activate_kw</string>
                             <string>kw</string>
+                            <string>Products.ERP5Type.Errors</string>
+                            <string>SimulationError</string>
                             <string>context</string>
                             <string>delivery</string>
                             <string>_getattr_</string>

Modified: erp5/trunk/bt5/erp5_base/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/revision?rev=40005&r1=40004&r2=40005&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/bt/revision [utf8] Sun Nov  7 04:12:22 2010
@@ -1 +1 @@
-894
\ No newline at end of file
+895
\ No newline at end of file

Modified: erp5/trunk/products/ERP5/Document/Delivery.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Delivery.py?rev=40005&r1=40004&r2=40005&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Delivery.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Delivery.py [utf8] Sun Nov  7 04:12:22 2010
@@ -34,6 +34,7 @@ from Products.CMFCore.utils import getTo
 from AccessControl import ClassSecurityInfo
 from Products.ERP5Type import Permissions, PropertySheet, interfaces
 from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
+from Products.ERP5Type.Errors import SimulationError
 from Products.ERP5Type.XMLObject import XMLObject
 from Products.ERP5.Document.ImmobilisationDelivery import ImmobilisationDelivery
 from Products.ERP5.mixin.amount_generator import AmountGeneratorMixin
@@ -765,8 +766,8 @@ class Delivery(XMLObject, Immobilisation
         # Re expand the rule if possible
         my_applied_rule = my_applied_rule_list[0]
       else:
-        raise "SimulationError", 'Delivery %s has more than one applied'\
-            ' rule.' % self.getRelativeUrl()
+        raise SimulationError('Delivery %s has more than one applied'
+                              ' rule.' % self.getRelativeUrl())
 
       my_applied_rule_id = None
       expand_activate_kw = {}
@@ -917,8 +918,8 @@ class Delivery(XMLObject, Immobilisation
       if method is not None:
         return method()
       else:
-        raise 'SimulationError', '%s_getRuleReference script is missing.' \
-              % self.getPortalType().replace(' ', '')
+        raise SimulationError('%s_getRuleReference script is missing.'
+                              % self.getPortalType().replace(' ', ''))
 
     security.declareProtected( Permissions.AccessContentsInformation,
                                'getRootSpecialiseValue')

Modified: erp5/trunk/products/ERP5/Document/SubscriptionItem.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/SubscriptionItem.py?rev=40005&r1=40004&r2=40005&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/SubscriptionItem.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/SubscriptionItem.py [utf8] Sun Nov  7 04:12:22 2010
@@ -32,6 +32,7 @@ from AccessControl import ClassSecurityI
 
 from Products.CMFCore.utils import getToolByName
 from Products.ERP5Type import Permissions, PropertySheet, interfaces
+from Products.ERP5Type.Errors import SimulationError
 from Products.ERP5.Document.Item import Item
 from Products.ERP5.mixin.rule import MovementGeneratorMixin
 from Products.ERP5.mixin.periodicity import PeriodicityMixin
@@ -119,8 +120,8 @@ class SubscriptionItem(Item, MovementGen
         rule_value_list = portal_rules.searchRuleList(self, 
                  tested_base_category_list=tested_base_category_list)
         if len(rule_value_list) > 1:
-          raise "SimulationError", 'Expandable Document %s has more than one matching'\
-                                   ' rule.' % self.getRelativeUrl()
+          raise SimulationError('Expandable Document %s has more than one'
+                                ' matching rule.' % self.getRelativeUrl())
         if len(rule_value_list):
           rule_value = rule_value_list[0]
           my_applied_rule = rule_value.constructNewAppliedRule(portal_simulation,
@@ -134,8 +135,8 @@ class SubscriptionItem(Item, MovementGen
       # Re expand the rule if possible
       my_applied_rule = my_applied_rule_list[0]
     else:
-      raise "SimulationError", 'Expandable Document %s has more than one root applied'\
-          ' rule.' % self.getRelativeUrl()
+      raise SimulationError('Expandable Document %s has more than one root'
+                            ' applied rule.' % self.getRelativeUrl())
 
     return my_applied_rule
 

Modified: erp5/trunk/products/ERP5Type/Errors.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Errors.py?rev=40005&r1=40004&r2=40005&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Errors.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Errors.py [utf8] Sun Nov  7 04:12:22 2010
@@ -42,6 +42,7 @@ class UnsupportedWorkflowMethod(Workflow
 class ImmobilisationValidityError(Exception):pass
 class ImmobilisationCalculationError(Exception):pass
 class TransformationRuleError(Exception):pass
+class SimulationError(Exception):pass
 
 
 allow_class(DeferredCatalogError)
@@ -51,3 +52,4 @@ allow_class(ImmobilisationCalculationErr
 allow_class(WorkflowException)
 allow_class(UnsupportedWorkflowMethod)
 allow_class(TransformationRuleError)
+allow_class(SimulationError)




More information about the Erp5-report mailing list