Commit dbdec138 authored by Sebastien Robin's avatar Sebastien Robin

change the constructor for base categories


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2042 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 42e97652
...@@ -39,6 +39,7 @@ from Products.ERP5Type.Utils import readLocalDocument, writeLocalDocument, impor ...@@ -39,6 +39,7 @@ from Products.ERP5Type.Utils import readLocalDocument, writeLocalDocument, impor
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
import cStringIO import cStringIO
from Products.ERP5Type.Cache import clearCache from Products.ERP5Type.Cache import clearCache
from Products.ERP5.Tool.Category import addBaseCategory
from zLOG import LOG from zLOG import LOG
...@@ -187,10 +188,7 @@ class CategoryTemplateItem(ObjectTemplateItem): ...@@ -187,10 +188,7 @@ class CategoryTemplateItem(ObjectTemplateItem):
for category_id in self._light_archive.keys(): for category_id in self._light_archive.keys():
if category_id in category_tool.objectIds(): if category_id in category_tool.objectIds():
raise TemplateConflictError, 'the category %s already exists' % id raise TemplateConflictError, 'the category %s already exists' % id
self.portal_types.constructContent(type_name='Category', addBaseCategory(category_tool, category_id)
container=category_tool,
id=category_id,
) # **kw) removed due to CMF bug
category = category_tool[category_id] category = category_tool[category_id]
property_list = self._light_archive[category_id]['property_list'] property_list = self._light_archive[category_id]['property_list']
for property,value in property_list.items(): for property,value in property_list.items():
......
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