Commit 12db67c0 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Deliveries can act as IDivergenceController

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30410 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bc87aa6e
# -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2002-2009 Nexedi SA and Contributors. All Rights Reserved. # Copyright (c) 2002-2009 Nexedi SA and Contributors. All Rights Reserved.
...@@ -27,10 +28,12 @@ ...@@ -27,10 +28,12 @@
# #
############################################################################## ##############################################################################
import zope.interface
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Base import WorkflowMethod from Products.ERP5Type.Base import WorkflowMethod
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5.Document.ImmobilisationDelivery import ImmobilisationDelivery from Products.ERP5.Document.ImmobilisationDelivery import ImmobilisationDelivery
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
...@@ -67,6 +70,9 @@ class Delivery(XMLObject, ImmobilisationDelivery): ...@@ -67,6 +70,9 @@ class Delivery(XMLObject, ImmobilisationDelivery):
, PropertySheet.Price , PropertySheet.Price
) )
# Declarative interfaces
zope.interface.implements(interfaces.IDivergenceController,)
security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable') security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable')
def isAccountable(self): def isAccountable(self):
""" """
...@@ -865,6 +871,11 @@ class Delivery(XMLObject, ImmobilisationDelivery): ...@@ -865,6 +871,11 @@ class Delivery(XMLObject, ImmobilisationDelivery):
def getBuilderList(self): def getBuilderList(self):
"""Returns appropriate builder list.""" """Returns appropriate builder list."""
return self._getTypeBasedMethod('getBuilderList')() return self._getTypeBasedMethod('getBuilderList')()
# XXX - quite a hack, since no way to know...
# propper implementation should use business path definition
# however, the real question is "is this really necessary"
# since the main purpose of this method is superceded
# by IDivergenceController
def getRuleReference(self): def getRuleReference(self):
"""Returns an appropriate rule reference.""" """Returns an appropriate rule reference."""
......
# -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2002, 2004 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2002, 2004 Nexedi SARL and Contributors. All Rights Reserved.
...@@ -27,6 +28,8 @@ ...@@ -27,6 +28,8 @@
# #
############################################################################## ##############################################################################
import zope.interface
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Acquisition import aq_base from Acquisition import aq_base
...@@ -69,6 +72,8 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement): ...@@ -69,6 +72,8 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
, PropertySheet.ItemAggregation , PropertySheet.ItemAggregation
) )
# Declarative interfaces
zope.interface.implements(interfaces.IDivergenceController,)
# MatrixBox methods # MatrixBox methods
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
......
# -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
...@@ -68,7 +69,8 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated, ...@@ -68,7 +69,8 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
, PropertySheet.SortIndex , PropertySheet.SortIndex
) )
#zope.interface.implements(interfaces.IDivergenceSolver,) # Declarative interfaces
zope.interface.implements(interfaces.IDivergenceController,)
# Multiple inheritance definition # Multiple inheritance definition
updateRelatedContent = XMLMatrix.updateRelatedContent updateRelatedContent = XMLMatrix.updateRelatedContent
......
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