Commit 9e0a9384 authored by Rafael Monnerat's avatar Rafael Monnerat

ERP5Configurator: Code style and drop getToolByName

parent 9bcb98c4
......@@ -57,5 +57,5 @@ class ConfigurationSave(Path):
if kw.has_key('conf_title'):
self.setTitle(kw['conf_title'])
kw.pop('conf_title')
conf_item = self.newContent(portal_type = configuration_item_class_name, **kw)
return conf_item
return self.newContent(portal_type=configuration_item_class_name,
**kw)
......@@ -30,7 +30,6 @@ import zope.interface
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.CMFCore.utils import getToolByName
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
class ExportCustomerBT5ConfiguratorItem(XMLObject, ConfiguratorItemMixin):
......@@ -56,8 +55,7 @@ class ExportCustomerBT5ConfiguratorItem(XMLObject, ConfiguratorItemMixin):
, PropertySheet.DublinCore )
def _build(self, business_configuration):
portal = self.getPortalObject()
template_tool = getToolByName(portal, 'portal_templates')
template_tool = self.getPortalObject().portal_templates
bt5_obj = business_configuration.getSpecialiseValue()
if bt5_obj.getBuildingState() != 'built':
## build template so it can be exported
......@@ -66,5 +64,5 @@ class ExportCustomerBT5ConfiguratorItem(XMLObject, ConfiguratorItemMixin):
bt5_data = template_tool.export(bt5_obj)
business_configuration.newContent(
portal_type='File',
title = bt5_obj.getTitle(),
data = bt5_data)
title=bt5_obj.getTitle(),
data=bt5_data)
......@@ -27,7 +27,6 @@
##############################################################################
import zope.interface
from Products.CMFCore.utils import getToolByName
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
......
......@@ -102,10 +102,10 @@ class SystemPreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
if preference is None:
preference = portal.portal_preferences.newContent(
portal_type = 'System Preference',
id = self.object_id,
title = self.title,
description = self.description,
priority = 1)
id=self.object_id,
title=self.title,
description=self.description,
priority=1)
# XXX this have to be translated in user language.
preference_dict = {}
......
......@@ -36,7 +36,6 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type.Cache import CachingMethod
from Products.ERP5Type import Permissions
from Products.ERP5Configurator import _dtmldir
from Products.CMFCore.utils import getToolByName
from Products.Formulator.Errors import FormValidationError
import cookielib
from base64 import encodestring
......@@ -430,8 +429,8 @@ class ConfiguratorTool(BaseTool):
activities should not exists.
"""
global installation_status
portal_activities = getToolByName(self.getPortalObject(),
'portal_activities')
portal_activities = self.getPortalObject().portal_activities
is_bt5_installation_over = (portal_activities.countMessageWithTag(
'initialERP5Setup') == 0)
if 0 == len(portal_activities.getMessageList()) and \
......
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