Commit 012128c4 authored by Rafael Monnerat's avatar Rafael Monnerat 👻

Preserve specified ids and not overwrite previous created object (This...

Preserve specified ids and not overwrite previous created object (This implementation may change in future).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44990 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a886df18
...@@ -58,13 +58,15 @@ class ServiceConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -58,13 +58,15 @@ class ServiceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
def build(self, business_configuration): def build(self, business_configuration):
portal = self.getPortalObject() portal = self.getPortalObject()
module = portal.service_module module = portal.service_module
# XXX Maybe this approach efficient and scalable.
object_id_list = module.objectIds()
for service_id, service_title in self.getServiceList(): for service_id, service_title in self.getServiceList():
# XXX FIXME We cannot define service_id like this, if service_id not in object_id_list:
# because it cause conflict when configurator is document = module.newContent(portal_type='Service',
# used twice. id=service_id,
document = module.newContent(portal_type='Service',
#id=service_id,
title=service_title, title=service_title,
) )
else:
document = module[service_id]
## add to customer template ## add to customer template
self.install(document, business_configuration) self.install(document, business_configuration)
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