Commit de193eb2 authored by Alexandre Boeglin's avatar Alexandre Boeglin

This patch was included in zope 2.7.5 which is quite old now.

No need to keep duplicate code.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7375 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d0741ef8
......@@ -29,7 +29,6 @@ from Products.ERP5Type.Utils import get_request
from Products.CMFCore.WorkflowCore import WorkflowException
from zLOG import LOG
import re
class CopyContainer:
"""
......@@ -177,25 +176,6 @@ class CopyContainer:
if REQUEST is not None:
return self.manage_main(self, REQUEST, update_menu=1)
copy_re=re.compile('^copy[0-9]*_of_')
def _get_id(self, id):
# Allow containers to override the generation of
# object copy id by attempting to call its _get_id
# method, if it exists.
copy_match=self.copy_re.match(id)
if (copy_match) and (copy_match.end() < len(id)):
n=1
orig_id=self.copy_re.sub('', id)
else:
n=0
orig_id=id
while 1:
if self._getOb(id, None) is None:
return id
id='copy%s_of_%s' % (n and n+1 or '', orig_id)
n=n+1
# Copy and paste support
def manage_afterClone(self, item):
"""
......
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