Commit 1ac3461d authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: More Mixins to migrate from Products.ERP5.mixin.

Move BusinessProcess Document from erp5_trade to erp5_core as CompositionMixin
depends on it and this Mixin is used by several Documents in erp5_core.
parent 96bbfad2
......@@ -41,7 +41,7 @@ from Products.ERP5.Document.Document import Document, \
from Products.ERP5Type.Utils import fill_args_from_request
# Mixin Import
from Products.ERP5.mixin.base_convertable import BaseConvertableFileMixin
from erp5.component.mixin.BaseConvertableFileMixin import BaseConvertableFileMixin
from Products.ERP5.mixin.text_convertable import TextConvertableMixin
from erp5.component.mixin.OOoDocumentExtensibleTraversableMixin import OOoDocumentExtensibleTraversableMixin
......
......@@ -32,7 +32,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from erp5.component.document.Item import Item
from Products.ERP5.mixin.composition import CompositionMixin
from erp5.component.mixin.CompositionMixin import CompositionMixin
from erp5.component.mixin.SimulableMixin import SimulableMixin
from erp5.component.mixin.MovementGeneratorMixin import MovementGeneratorMixin
from Products.ERP5.mixin.periodicity import PeriodicityMixin
......
......@@ -36,7 +36,7 @@ import zope.interface
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.mixin.composition import _getEffectiveModel
from erp5.component.mixin.CompositionMixin import _getEffectiveModel
from erp5.component.document.MappedValue import MappedValue
from erp5.component.mixin.AmountGeneratorMixin import AmountGeneratorMixin
from Products.ERP5.mixin.variated import VariatedMixin
......
document.erp5.BusinessLink
document.erp5.BusinessProcess
document.erp5.Container
document.erp5.ContainerCell
document.erp5.ContainerLine
......
interface.erp5.IBusinessLink
interface.erp5.IBusinessProcess
interface.erp5.ITradeModelPath
interface.erp5.IBuildableBusinessLinkProcess
interface.erp5.IBusinessLinkProcess
......
portal_components/document.erp5.BusinessProcess
portal_components/interface.erp5.IBusinessProcess
\ No newline at end of file
......@@ -28,7 +28,7 @@
##############################################################################
from Products.ERP5.Document.WebSite import WebSite as SimpleWebSite
from Products.ERP5.mixin.virtual_folder import VirtualFolderMixin
from erp5.component.mixin.VirtualFolderMixin import VirtualFolderMixin
class WebSite(VirtualFolderMixin, SimpleWebSite):
"""
......
......@@ -40,7 +40,7 @@ from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.XMLObject import XMLObject
from erp5.component.document.ImmobilisationDelivery import ImmobilisationDelivery
from erp5.component.mixin.AmountGeneratorMixin import AmountGeneratorMixin
from Products.ERP5.mixin.composition import CompositionMixin
from erp5.component.mixin.CompositionMixin import CompositionMixin
from erp5.component.mixin.SimulableMixin import SimulableMixin
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod, \
unrestricted_apply
......
......@@ -35,7 +35,7 @@ from Products.ERP5Type import Permissions, PropertySheet
from erp5.component.document.TextDocument import TextDocument
from Products.ERP5.Document.File import File
from erp5.component.mixin.MailMessageMixin import MailMessageMixin, testCharsetAndConvert
from Products.ERP5.mixin.document_proxy import DocumentProxyMixin, DocumentProxyError
from erp5.component.mixin.DocumentProxyMixin import DocumentProxyMixin, DocumentProxyError
from MethodObject import Method
try:
......
......@@ -40,7 +40,7 @@ from Products.ERP5Type.Base import Base
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.UnrestrictedMethod import unrestricted_apply
from erp5.component.mixin.AmountGeneratorMixin import AmountGeneratorMixin
from Products.ERP5.mixin.composition import CompositionMixin
from erp5.component.mixin.CompositionMixin import CompositionMixin
from erp5.component.document.Amount import Amount
from Products.ERP5Type.Cache import transactional_cached
from erp5.component.interface.IAmountGenerator import IAmountGenerator
......
......@@ -40,7 +40,7 @@ from string import Template
# Mixin Import
from Products.ERP5.mixin.cached_convertable import CachedConvertableMixin
from Products.ERP5.mixin.base_convertable import BaseConvertableFileMixin
from erp5.component.mixin.BaseConvertableFileMixin import BaseConvertableFileMixin
from Products.ERP5Type.mixin.text_content_history import TextContentHistoryMixin
from Products.ERP5Type.Utils import guessEncodingFromText
......
......@@ -32,7 +32,7 @@ from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type import Permissions
from OFS.Image import Pdata
from cStringIO import StringIO
_MARKER = []
_MARKER = object()
class BaseConvertableFileMixin:
"""
......@@ -96,8 +96,8 @@ class BaseConvertableFileMixin:
"""Wrap value into Pdata
"""
if not isinstance(data, Pdata) and data is not None:
file = StringIO(data)
data, size = self._read_data(file)
file_ = StringIO(data)
data, _ = self._read_data(file_)
self._baseSetBaseData(data)
InitializeClass(BaseConvertableFileMixin)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Mixin Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>BaseConvertableFileMixin</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.mixin.base_convertable</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>mixin.erp5.BaseConvertableFileMixin</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Mixin Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -36,7 +36,7 @@ from Products.ERP5Type.Utils import sortValueList
from Products.ERP5Type.Core.Predicate import Predicate
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
_MARKER = []
_MARKER = object()
@transactional_cached()
def _getEffectiveModel(self, start_date, stop_date):
......@@ -169,8 +169,7 @@ class asComposedDocument(object):
if portal_type is not None:
if isinstance(portal_type, str):
portal_type = (portal_type,)
object_list = filter(lambda x: x.getPortalType() in portal_type,
object_list)
object_list = [x for x in object_list if x.getPortalType() in portal_type]
return sortValueList(object_list, sort_on, sort_order, **kw)
def getProperty(self, key, d=_MARKER, **kw):
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Mixin Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>CompositionMixin</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.mixin.composition</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>mixin.erp5.CompositionMixin</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Mixin Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Mixin Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>DocumentProxyMixin</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.mixin.document_proxy</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>mixin.erp5.DocumentProxyMixin</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Mixin Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -28,7 +28,7 @@
##############################################################################
_marker=[]
_marker=object()
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Globals import InitializeClass
......@@ -60,7 +60,7 @@ class VirtualFolderMixin:
return Folder.PUT_factory(self, name, typ, body)
security.declarePrivate('_setObject')
def _setObject(self, id, ob, **kw):
def _setObject(self, id, ob, **kw): # pylint: disable=redefined-builtin
"""
XXX
"""
......@@ -75,7 +75,7 @@ class VirtualFolderMixin:
return Folder._setObject(self, id, ob, **kw)
security.declarePrivate('_getOb')
def _getOb(self, id, default=_marker, **kw):
def _getOb(self, id, default=_marker, **kw): # pylint: disable=redefined-builtin
"""
XXX
"""
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Mixin Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>VirtualFolderMixin</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.mixin.virtual_folder</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>mixin.erp5.VirtualFolderMixin</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Mixin Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,6 +2,7 @@ document.erp5.Amount
document.erp5.AmountGeneratorLine
document.erp5.AppliedRule
document.erp5.BaseDomain
document.erp5.BusinessProcess
document.erp5.ContributionPredicate
document.erp5.Delivery
document.erp5.DeliveryCell
......
......@@ -2,6 +2,7 @@ interface.erp5.IAccountingMovement
interface.erp5.IAmountGenerator
interface.erp5.IAmountGeneratorLine
interface.erp5.IAssetMovement
interface.erp5.IBusinessProcess
interface.erp5.IDivergenceController
interface.erp5.IExpandable
interface.erp5.IImmobilisationItem
......
mixin.erp5.AmountGeneratorMixin
mixin.erp5.BaseConvertableFileMixin
mixin.erp5.CompositionMixin
mixin.erp5.DocumentProxyMixin
mixin.erp5.ExplainableMixin
mixin.erp5.MailMessageMixin
mixin.erp5.MovementCollectionUpdaterMixin
mixin.erp5.MovementGeneratorMixin
mixin.erp5.RuleMixin
mixin.erp5.SimulableMixin
\ No newline at end of file
mixin.erp5.SimulableMixin
mixin.erp5.VirtualFolderMixin
\ No newline at end of file
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