Commit 083d1dfe authored by Romain Courteaud's avatar Romain Courteaud

Modify generation of Applied Rule's ID.

Do not copy anymore Rule ID, but simply generate a new one, in order to reduce
the length of path in simulation.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3414 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 66451cdb
...@@ -87,12 +87,7 @@ class Rule(XMLObject, Predicate): ...@@ -87,12 +87,7 @@ class Rule(XMLObject, Predicate):
""" """
portal_types = getToolByName(self, 'portal_types') portal_types = getToolByName(self, 'portal_types')
if id is None: if id is None:
if context.getRelativeUrl() == 'portal_simulation': id = context.generateNewId()
# Name the rule according to a number (we are at the root of the simulation)
id = context.generateNewId()
else:
# Name the rule according to its instance id
id = self.getId()
if getattr(aq_base(context), id, None) is None: if getattr(aq_base(context), id, None) is None:
context.newContent(id=id, portal_type='Applied Rule', specialise_value=self,**kw) context.newContent(id=id, portal_type='Applied Rule', specialise_value=self,**kw)
return context.get(id) return context.get(id)
......
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