Commit 801a347e authored by Arnaud Fontaine's avatar Arnaud Fontaine

Component should have never been a Document but a mixin.

parent be17e8bd
......@@ -27,11 +27,11 @@
#
##############################################################################
from Products.ERP5Type.Core.Component import Component
from Products.ERP5Type.mixin.component import ComponentMixin
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
class DocumentComponent(Component):
class DocumentComponent(ComponentMixin):
# CMF Type Definition
meta_type = 'ERP5 Document Component'
portal_type = 'Document Component'
......
......@@ -27,11 +27,11 @@
#
##############################################################################
from Products.ERP5Type.Core.Component import Component
from Products.ERP5Type.mixin.component import ComponentMixin
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
class ExtensionComponent(Component):
class ExtensionComponent(ComponentMixin):
# CMF Type Definition
meta_type = 'ERP5 Extension Component'
portal_type = 'Extension Component'
......
......@@ -39,11 +39,7 @@ from Products.ERP5Type.ConsistencyMessage import ConsistencyMessage
from zLOG import LOG, INFO
class Component(Base):
# CMF Type Definition
meta_type = 'ERP5 Component'
portal_type = 'Component'
class ComponentMixin(Base):
isPortalContent = 1
isRADContent = 1
isDelivery = ConstantGetter('isDelivery', value=True)
......@@ -132,7 +128,7 @@ class Component(Base):
previous_validation_workflow['error_message'] = ''
previous_validation_workflow['text_content'] = ''
else:
super(Component, self)._setTextContent(text_content)
super(ComponentMixin, self)._setTextContent(text_content)
self.validate()
if validation_state == 'modified':
......@@ -142,7 +138,7 @@ class Component(Base):
previous_validation_workflow['error_message'] = ''
previous_validation_workflow['text_content'] = ''
else:
return super(Component, self)._setTextContent(text_content)
return super(ComponentMixin, self)._setTextContent(text_content)
security.declareProtected(Permissions.AccessContentsInformation,
'getTextContent')
......@@ -161,7 +157,7 @@ class Component(Base):
if text_content_non_validated:
return text_content_non_validated
return super(Component, self).getTextContent()
return super(ComponentMixin, self).getTextContent()
def _getErrorMessage(self):
current_workflow = self.workflow_history['component_validation_workflow'][-1]
......
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