Commit ee474064 authored by Alexandre Boeglin's avatar Alexandre Boeglin

previous commit was a mistake, reverted


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6442 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5ec1ebf1
......@@ -34,7 +34,6 @@ from Products.ERP5.Document.Periodicity import Periodicity
from Products.CMFCore.WorkflowCore import WorkflowMethod
from Acquisition import aq_base, aq_parent, aq_inner, aq_acquire
from Products.CMFCore.utils import getToolByName
from Products.PageTemplates.Expressions import getEngine
from DateTime import DateTime
from zLOG import LOG
......@@ -82,17 +81,6 @@ class Alarm(Periodicity, XMLObject):
"""
return self.hasActivity()
def callActiveSenseMethod(self, tales_expression):
"""
This resolves the active_sense_method, and calls it
"""
context = { 'here' : self.aq_parent,
'context' : self.aq_parent,
'request' : None }
compiled_tales = getEngine().compile(tales_expression)
return getEngine().getContext(context).evaluate(compiled_tales)
security.declareProtected(Permissions.ModifyPortalContent, 'activeSense')
def activeSense(self):
"""
......@@ -111,10 +99,8 @@ class Alarm(Periodicity, XMLObject):
self.reindexObject()
method_id = self.getActiveSenseMethodId()
if method_id is not None:
return self.activate().callActiveSenseMethod(method_id)
# method = getattr(self.activate(),method_id)
# return method()
s
method = getattr(self.activate(),method_id)
return method()
security.declareProtected(Permissions.ModifyPortalContent, 'sense')
def sense(self):
......
......@@ -306,12 +306,7 @@ class Amount(Base, Variated):
raise KeyError, "Can not set the property variation '%s'" % \
property_id
else:
try:
self.setProperty(property_id, property_value)
except KeyError:
LOG("Amount", 200, "Can not set %s with value %s on %s" % \
(property_id, property_value, self.getRelativeUrl()))
raise
self.setProperty(property_id, property_value)
security.declareProtected(Permissions.AccessContentsInformation,
'getQuantityUnitRangeItemList')
......
......@@ -454,8 +454,6 @@ class SimulationMovement(Movement):
self.getResource() != delivery.getResource() or \
self.getVariationCategoryList() != delivery.getVariationCategoryList()\
or \
#self.getAggregateValueList() != delivery.getAggregateValueList()\
or \
self.getAggregateList() != delivery.getAggregateList() or \
self.getStartDate() != delivery.getStartDate() or \
self.getStopDate() != delivery.getStopDate():
......
......@@ -329,8 +329,6 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
)
tmp_amount.setVariationCategoryList(variation_category_list)
# Variation property dict
prop_dict = self.getVariationPropertyDict()
tmp_amount.setVariationPropertyDict(prop_dict)
tmp_amount.setVariationPropertyDict(self.getVariationPropertyDict())
aggregated_amount_list.append(tmp_amount)
return aggregated_amount_list
......@@ -182,7 +182,7 @@ class Person:
, 'storage_id' : 'default_career'
, 'description' : 'The default career hold some properties of a Person.'
, 'type' : 'content'
, 'portal_type' : 'Career'
, 'portal_type' : ( 'Career', )
, 'acquired_property_id': ( 'start_date', 'stop_date', 'title', 'description'
, 'subordination', 'subordination_title', 'subordination_value'
, 'subordination_uid_list', 'subordination_uid'
......@@ -193,6 +193,7 @@ class Person:
, 'role', 'role_id', 'role_title', 'role_value'
, 'function', 'function_id', 'function_title', 'function_value'
)
, 'deprecated' : 1
, 'mode' : 'w'
},
)
......
......@@ -103,8 +103,8 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
my_base_category = base_category
bo = getattr(self, my_base_category, None)
if bo is not None:
bo_uid = bo.getUid()
uid_dict[(o.getUid(), bo_uid, 1)] = 1 # Strict membership
bo_uid = int(bo.getUid())
uid_dict[(int(o.uid), bo_uid, 1)] = 1 # Strict membership
if o.meta_type == 'ERP5 Category' or o.meta_type == 'ERP5 Base Category' or \
o.meta_type == 'CMF Category' or o.meta_type == 'CMF Base Category':
# This goes up in the category tree
......@@ -113,7 +113,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
if not strict:
while o.meta_type == 'ERP5 Category' or o.meta_type == 'CMF Category':
o = o.aq_parent
uid_dict[(o.getUid(), bo_uid, 0)] = 1 # Non strict
uid_dict[(int(o.uid), bo_uid, 0)] = 1 # Non strict
except (TypeError, KeyError):
LOG('WARNING: CategoriesTool',0, 'Unable to find uid for %s' % path)
return uid_dict.keys()
......
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