Commit 4b6d633c authored by Jean-Paul Smets's avatar Jean-Paul Smets

Fixed usage of Transactional Variable

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15852 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 421c13dd
......@@ -71,13 +71,13 @@ class OrderLine(DeliveryLine):
"""Return true if the object contains lines.
We cache results in a volatile variable.
"""
acquisition_key = ('hasLineContent', self.getPath())
transactional_variable = getTransactionalVariable(acquisition_key)
transactional_variable = getTransactionalVariable(self)
call_method_key = ('Products.ERP5.Document.OrderLine.hasLineContent', self.getPhysicalPath())
try:
result = transactional_variable['hasLineContent']
result = transactional_variable[call_method_key]
except KeyError:
result = (len(self.contentValues(meta_type=self.meta_type)) > 0)
transactional_variable['hasLineContent'] = result
result = len(self.contentValues(meta_type=self.meta_type)) > 0
transactional_variable[call_method_key] = result
return result
def applyToOrderLineRelatedMovement(self, portal_type='Simulation Movement',
......
......@@ -128,11 +128,11 @@ class WorkflowMethod(Method):
# Check if this method has already been called in this transaction
# (only check this if we use once only workflow methods)
call_method_key = ('Products.ERP5Type.Base.WorkflowMethod.__call__', self._id, instance.getPhysicalPath())
transactional_variable = getTransactionalVariable(call_method_key)
transactional_variable = getTransactionalVariable(instance)
try:
call_method = transactional_variable['call_method_key']
call_method = transactional_variable[call_method_key]
except KeyError:
transactional_variable['call_method_dict'] = 1
transactional_variable[call_method_key] = 1
if call_method and not self._invoke_always:
# Try to return immediately if there are no invoke always workflow methods
......
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