Commit cfa39bdb authored by Jérome Perrin's avatar Jérome Perrin

fix the way we store comment in wf history

parent 3159a007
......@@ -30,6 +30,7 @@ import zope.interface
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Message import translateString
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
class AccountConfiguratorItem(ConfiguratorItemMixin, XMLObject):
......@@ -79,7 +80,7 @@ class AccountConfiguratorItem(ConfiguratorItemMixin, XMLObject):
# Update existing account
if (self.getAccountType() != account.getAccountType()) and \
(self.getFinancialSection() != account.getFinancialSection()):
raise ValueError("The Configurator is trying to overwritte previous configuration information (%s)" % account.getRelativeUrl())
raise ValueError("The Configurator is trying to overwrite previous configuration information (%s)" % account.getRelativeUrl())
account.edit(title=self.getTitle(), description=self.getDescription())
gap_list = account.getGapList()
......@@ -90,7 +91,7 @@ class AccountConfiguratorItem(ConfiguratorItemMixin, XMLObject):
account.setCreditAccount(self.isCreditAccount())
if self.portal_workflow.isTransitionPossible(account, 'validate'):
account.validate(comment="Validated by Configurator")
account.validate(comment=translateString("Validated by Configurator"))
## add to customer template
self.install(account, business_configuration)
......@@ -30,6 +30,7 @@ import zope.interface
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Message import translateString
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
class CurrencyConfiguratorItem(ConfiguratorItemMixin, XMLObject):
......@@ -72,7 +73,7 @@ class CurrencyConfiguratorItem(ConfiguratorItemMixin, XMLObject):
title = title,
reference = reference,
base_unit_quantity = base_unit_quantity)
currency.validate()
currency.validate(comment=translateString("Validated by Configurator"))
business_configuration.setGlobalConfigurationAttr(currency_id=currency.getId())
## add to customer template
self.install(currency, business_configuration)
......@@ -30,6 +30,7 @@ import zope.interface
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Message import translateString
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject):
......@@ -78,7 +79,7 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject):
business_configuration.setGlobalConfigurationAttr(organisation_id=organisation.getId())
if self.portal_workflow.isTransitionPossible(organisation, 'validate'):
organisation.validate(comment="Validated by Configurator")
organisation.validate(comment=translateString("Validated by Configurator"))
## add to customer template
self.install(organisation, business_configuration)
......@@ -31,6 +31,7 @@ from Acquisition import aq_base
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Message import translateString
from DateTime import DateTime
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
......@@ -92,8 +93,8 @@ class PersonConfiguratorItem(XMLObject, ConfiguratorItemMixin):
assignment.setStopDate(now + (365*10))
# Validate the Person and Assigment
person.validate(comment="Validated by Configurator")
assignment.open(comment="Open by Configuration")
person.validate(comment=translateString("Validated by Configurator"))
assignment.open(comment=translateString("Open by Configuration"))
## add to customer template
self.install(person, business_configuration)
......@@ -31,6 +31,7 @@ from AccessControl import ClassSecurityInfo
from DateTime import DateTime
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Message import translateString
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
......@@ -82,6 +83,6 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
trade_condition.setDestinationSection("organisation_module/%s" % organisation_id)
trade_condition.setPriceCurrency("currency_module/%s" % currency_id)
trade_condition.validate(comment="Validated by Configurator")
trade_condition.validate(comment=translateString("Validated by Configurator"))
self.install(trade_condition, business_configuration)
......@@ -31,6 +31,7 @@ from DateTime import DateTime
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Message import translateString
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
class SaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
......@@ -82,6 +83,6 @@ class SaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
trade_condition.setSourceSection("organisation_module/%s" % organisation_id)
trade_condition.setPriceCurrency("currency_module/%s" % currency_id)
trade_condition.validate(comment="Validated by Configurator")
trade_condition.validate(comment=translateString("Validated by Configurator"))
self.install(trade_condition, business_configuration)
......@@ -26,10 +26,12 @@
#
##############################################################################
from warnings import warn
import zope.interface
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Message import translateString
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
class ServiceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
......@@ -61,8 +63,8 @@ class ServiceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
document = getattr(portal.service_module, service_id, None)
if document is None:
document = portal.service_module.newContent(portal_type='Service',
id=service_id, title=service_title)
document.validate("Validated by Configurator")
id=service_id, **service_dict)
document.validate(comment=translateString("Validated by Configurator"))
## add to customer template
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