Commit 2dd6ad08 authored by Sebastien Robin's avatar Sebastien Robin

- the possibility to pass --enable_full_indexing=portal_skins in

 order to make optimisation configuration in unit test
- isIndexable is not a property any more, it is a ConstantGetter
 instance, so it works like a property and like a method
- same thing for isPredicate, isTemplate, isDelivery... we can
 start moving using only methods.
- do not define isTemplate, isDelivery... when it is already
  available thanks to inheritance
- new methods generated for all ERP5 objects : provides[InterfaceName].
 For instance, "providesIMovement()" will return True or False for
 any ERP5 object.
- new method "is[Group]Type" generated for all ERP5 objects. The group
 here is group of portal types (like getPortalDeliveryTypeList()). So
 on any ERP5 object, you can do "isDeliveryType()", and this will
 returns True or False.
- add tests

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30704 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3a9c4b53
......@@ -37,9 +37,6 @@ class DummyMovement(Movement):
meta_type = 'ERP5 Dummy Movement'
portal_type = 'Dummy Movement'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isMovement = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -63,8 +63,6 @@ class ActiveProcess(Base):
meta_type = 'CMF Active Process'
portal_type = 'Active Process'
isPortalContent = 0
isRADContent = 1
icon = None
# Declarative security
......
......@@ -36,6 +36,7 @@ from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions
from Products.ERP5Type import PropertySheet
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.Core.Folder import Folder
from Products.CMFCategory.Renderer import Renderer
from Products.ERP5Type.Utils import sortValueList
......@@ -117,9 +118,7 @@ class Category(Folder):
meta_type='CMF Category'
portal_type='Category' # may be useful in the future...
isPortalContent = 1
isRADContent = 1
isCategory = 1
isCategory = ConstantGetter('isCategory', value=True)
icon = None
allowed_types = (
......@@ -778,9 +777,7 @@ class BaseCategory(Category):
"""
meta_type='CMF Base Category'
portal_type='Base Category' # maybe useful some day
isPortalContent = 1
isRADContent = 1
isBaseCategory = 1
isBaseCategory = ConstantGetter('isBaseCategory', value=True)
constructors = (manage_addBaseCategoryForm, addBaseCategory)
......
......@@ -39,8 +39,6 @@ class AcceptSolver(XMLObject):
meta_type = 'ERP5 Accept Solver'
portal_type = 'Accept Solver'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isIndexable = 0 # We do not want to fill the catalog with objects on which we need no reporting
# Declarative security
......
......@@ -67,8 +67,6 @@ class Account(XMLObject):
meta_type = 'ERP5 Account'
portal_type = 'Account'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -59,9 +59,6 @@ An AccountingRuleCell object allows to add SaleInvoiceTransactionLines into a Ma
meta_type = 'ERP5 Accounting Rule Cell'
portal_type = 'Accounting Rule Cell'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isDelivery = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -44,9 +44,6 @@ class AccountingTransaction(Delivery):
meta_type = 'ERP5 Accounting Transaction'
portal_type = 'Accounting Transaction'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isDelivery = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -42,8 +42,6 @@ class AccountingTransactionLine(DeliveryLine):
meta_type = 'ERP5 Accounting Transaction Line'
portal_type = 'Accounting Transaction Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -28,6 +28,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5.Document.EmailDocument import EmailDocumentProxyMixin
from Products.ERP5.Document.Event import Event
......@@ -54,9 +55,7 @@ class Acknowledgement(EmailDocumentProxyMixin, Event):
meta_type = 'ERP5 Acknowledgement'
portal_type = 'Acknowledgement'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isDelivery = 1
isDelivery = ConstantGetter('isDelivery', value=True)
# Declarative security
security = ClassSecurityInfo()
......
......@@ -39,8 +39,6 @@ class AdoptSolver(XMLObject):
meta_type = 'ERP5 Adopt Solver'
portal_type = 'Adopt Solver'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isIndexable = 0 # We do not want to fill the catalog with objects on which we need no reporting
# Declarative security
......
......@@ -42,8 +42,6 @@ class Agent(Folder, Image):
# CMF Type Definition
meta_type = 'ERP5 Agent'
portal_type = 'Agent'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -39,8 +39,6 @@ class AgentPrivilege(XMLObject):
# CMF Type Definition
meta_type = 'ERP5 Agent Privilege'
portal_type = 'Agent Privilege'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -256,8 +256,6 @@ class Alarm(XMLObject, PeriodicityMixin):
meta_type = 'ERP5 Alarm'
portal_type = 'Alarm'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -50,8 +50,6 @@ class AmortisationRule(Rule):
meta_type = 'ERP5 Amortisation Rule'
portal_type = 'Amortisation Rule'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -56,8 +56,6 @@ class AmountFilter(MappedValue, Amount):
meta_type = 'ERP5 Amount Filter'
portal_type = 'Amount Filter'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -45,8 +45,6 @@ class AnnotationLine(PaySheetLine):
meta_type = 'ERP5 Annotation Line'
portal_type = 'Annotation Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -38,8 +38,6 @@ class Assignment(Path):
meta_type = 'ERP5 Assignment'
portal_type = 'Assignment'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -115,8 +115,6 @@ class AssortedResource(TransformedResource):
meta_type = 'ERP5 Assorted Resource'
portal_type = 'Assorted Resource'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -84,9 +84,6 @@ class BalanceTransaction(AccountingTransaction, Inventory):
meta_type = 'ERP5 Balance Transaction'
portal_type = 'Balance Transaction'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isDelivery = 1
#zope.interface.implements( interfaces.Inventory, )
......
......@@ -29,6 +29,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5.Document.AccountingTransactionLine import \
AccountingTransactionLine
from Products.ERP5.Document.InventoryLine import InventoryLine
......@@ -42,9 +43,7 @@ class BalanceTransactionLine(AccountingTransactionLine, InventoryLine):
meta_type = 'ERP5 Balance Transaction Line'
portal_type = 'Balance Transaction Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isIndexable = 0
isIndexable = ConstantGetter('isIndexable', value=False)
# Declarative security
security = ClassSecurityInfo()
......
......@@ -50,8 +50,6 @@ class BankAccount(Folder, Coordinate, MetaNode):
meta_type = 'ERP5 Bank Account'
portal_type = 'Bank Account'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -30,6 +30,7 @@ from Products.CMFCategory.Category import BaseCategory as CMFBaseCategory
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import interfaces, Permissions, PropertySheet
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Base import _aq_reset
......@@ -43,9 +44,7 @@ class BaseCategory(CMFBaseCategory, XMLObject):
"""
meta_type='ERP5 Base Category'
portal_type='Base Category' # maybe useful some day
isPortalContent = 1
isRADContent = 1
isCategory = 1
isCategory = ConstantGetter('isCategory', value=True)
allowed_types = ('ERP5 Category', )
# Declarative security
......
......@@ -44,8 +44,6 @@ class BaseDomain(Domain):
meta_type = 'ERP5 Base Domain'
portal_type = 'Base Domain'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -40,8 +40,6 @@ class Binder(Folder, Document):
meta_type = 'ERP5 Binder'
portal_type = 'Binder'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -61,8 +61,6 @@ class Budget(Predicate, Variated):
meta_type='ERP5 Budget'
portal_type='Budget'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -60,8 +60,6 @@ class BudgetCell(Predicate, MetaNode, Movement):
meta_type='ERP5 Budget Cell'
portal_type='Budget Cell'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -63,8 +63,6 @@ class BudgetLine(Predicate, XMLMatrix, Variated):
meta_type='ERP5 Budget Line'
portal_type='Budget Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -52,8 +52,6 @@ class BudgetModel(Predicate):
meta_type = 'ERP5 Budget Model'
portal_type = 'Budget Model'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -54,8 +54,6 @@ class BudgetTransaction(DeliveryLine):
meta_type='ERP5 Budget Transaction'
portal_type='Budget Transaction'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -53,8 +53,6 @@ class BudgetTransfer(Supply):
meta_type='ERP5 Budget Transfer'
portal_type='Budget Transfer'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -54,8 +54,6 @@ class BudgetTransferLine(SupplyLine):
meta_type='ERP5 Budget Transfer Line'
portal_type='Budget Transfer Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -55,8 +55,6 @@ class BudgetVariation(Predicate):
meta_type='ERP5 Budget Variation'
portal_type='Budget Variation'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -38,9 +38,6 @@ class Bug(Ticket):
meta_type = 'ERP5 Bug'
portal_type = 'Bug'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isDelivery = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -65,7 +65,6 @@ class BusinessPath(Path):
"""
meta_type = 'ERP5 Business Path'
portal_type = 'Business Path'
isPredicate = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -48,7 +48,6 @@ class BusinessProcess(Path, XMLObject):
"""
meta_type = 'ERP5 Business Process'
portal_type = 'Business Process'
isPredicate = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -33,6 +33,7 @@ from Products.ERP5Type.Globals import Persistent, PersistentMapping
from Acquisition import Implicit, aq_base
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.Base import WorkflowMethod, _aq_reset
from Products.ERP5Type.Utils import readLocalDocument, \
writeLocalDocument, \
......@@ -919,7 +920,7 @@ class ObjectTemplateItem(BaseTemplateItem):
# manage_afterClone in order to not call recursiveReindex, this is
# useless because we will already reindex every created object, so
# we avoid duplication of reindexation
obj.isIndexable = 0
obj.isIndexable = ConstantGetter('isIndexable', value=False)
obj.manage_afterClone(obj)
del obj.isIndexable
if getattr(aq_base(obj), 'reindexObject', None) is not None:
......@@ -4615,8 +4616,6 @@ class BusinessTemplate(XMLObject):
meta_type = 'ERP5 Business Template'
portal_type = 'Business Template'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -37,8 +37,6 @@ class Calendar(Delivery):
# CMF Type Definition
meta_type = 'ERP5 Calendar'
portal_type = 'Calendar'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -38,8 +38,6 @@ class CalendarException(XMLObject):
# CMF Type Definition
meta_type = 'ERP5 Calendar Exception'
portal_type = 'Calendar Exception'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -32,6 +32,7 @@ from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.XMLObject import XMLObject
......@@ -41,7 +42,7 @@ class Capacity(XMLObject):
"""
meta_type = 'ERP5 Capacity'
isCapacity = 1
isCapacity = ConstantGetter('isCapacity', value=True)
# Declarative security
security = ClassSecurityInfo()
......
......@@ -42,8 +42,6 @@ class Career(Path):
meta_type = 'ERP5 Career'
portal_type = 'Career'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -32,6 +32,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5.Document.MetaNode import MetaNode
from Products.ERP5.Document.MetaResource import MetaResource
from Products.ERP5Type import interfaces, Permissions, PropertySheet
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.Base import Base
from Products.ERP5.Document.Predicate import Predicate
......@@ -93,9 +94,7 @@ class Category(CMFCategory, Predicate, MetaNode, MetaResource):
meta_type='ERP5 Category'
portal_type='Category' # may be useful in the future...
isPortalContent = 1
isRADContent = 1
isCategory = 1
isCategory = ConstantGetter('isCategory', value=True)
allowed_types = ('ERP5 Category', )
# Declarative security
......
......@@ -50,8 +50,6 @@ class CategoryBudgetVariation(BudgetVariation):
meta_type = 'ERP5 Category Budget Variation'
portal_type = 'Category Budget Variation'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -44,8 +44,6 @@ class CategoryDivergenceTester(PropertyDivergenceTester):
meta_type = 'ERP5 Category Divergence Tester'
portal_type = 'Category Divergence Tester'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -39,8 +39,6 @@ class Computer(Machine):
meta_type = 'ERP5 Computer'
portal_type = 'Computer'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -44,7 +44,6 @@ class ContainerCell(DeliveryCell):
meta_type = 'ERP5 Container Cell'
portal_type = 'Container Cell'
isCell = 1
isMovement = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -41,9 +41,6 @@ class ContributionPredicate(Predicate, XMLObject):
meta_type = 'ERP5 Contribution Predicate'
portal_type = 'Contribution Predicate'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isPredicate = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -77,8 +77,6 @@ class Coordinate(Base):
meta_type = 'ERP5 Coordinate'
portal_type = 'Coordinate'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative interface
zope.interface.implements(interfaces.ICoordinate, )
......
......@@ -41,8 +41,6 @@ class Currency(Resource):
meta_type = 'ERP5 Currency'
portal_type = 'Currency'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -34,6 +34,7 @@ from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Base import WorkflowMethod
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5.Document.ImmobilisationDelivery import ImmobilisationDelivery
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
......@@ -49,9 +50,7 @@ class Delivery(XMLObject, ImmobilisationDelivery):
# CMF Type Definition
meta_type = 'ERP5 Delivery'
portal_type = 'Delivery'
isPortalContent = 1
isRADContent = 1
isDelivery = 1
isDelivery = ConstantGetter('isDelivery', value=True)
# Declarative security
security = ClassSecurityInfo()
......
......@@ -53,7 +53,6 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
meta_type = 'ERP5 Delivery Cell'
portal_type = 'Delivery Cell'
isCell = 1
isMovement = 1
# Declarative security
security = ClassSecurityInfo()
......@@ -179,3 +178,8 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
parent = parent.getParentValue()
if parent is not None:
parent.updateSimulationDeliveryProperties(movement_list, self)
security.declareProtected(Permissions.AccessContentsInformation, 'isMovement')
def isMovement(self):
return 1
......@@ -41,8 +41,6 @@ class DependentCapacity(Capacity):
meta_type = 'ERP5 Dependent Capacity'
portal_type = 'Dependent Capacity'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -40,8 +40,6 @@ class Device(Item):
meta_type = 'ERP5 Device'
portal_type = 'Device'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -33,6 +33,7 @@ from zLOG import LOG
from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager, setSecurityManager
from Acquisition import aq_base
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.Globals import get_request
from Products.CMFCore.utils import getToolByName, _checkPermission
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......@@ -489,9 +490,7 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin, S
meta_type = 'ERP5 Document'
portal_type = 'Document'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isDocument = 1
isDocument = ConstantGetter('isDocument', value=True)
__dav_collection__=0
zope.interface.implements(interfaces.IConvertable,
......
......@@ -74,8 +74,6 @@ class Domain(Predicate, MetaNode, MetaResource):
meta_type = 'ERP5 Domain'
portal_type = 'Domain'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -28,6 +28,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.XMLObject import XMLObject
......@@ -44,8 +45,7 @@ class DomainGenerator(XMLObject):
"""
meta_type='ERP5 Domain Generator'
portal_type='Domain Generator'
isPortalContent = 0
isRADContent = 1
isPortalContent = ConstantGetter('isPortalContent', value=False)
icon = None
security = ClassSecurityInfo()
......
......@@ -31,6 +31,7 @@ import re, types
from DateTime import DateTime
from Products.ERP5Type.Globals import get_request
from AccessControl import ClassSecurityInfo, Unauthorized
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.Base import WorkflowMethod
from Products.CMFCore.utils import getToolByName, _checkPermission
from Products.CMFCore.utils import _setCacheHeaders, _ViewEmulator
......@@ -135,10 +136,8 @@ class EmailDocument(File, TextDocument):
meta_type = 'ERP5 Email Document'
portal_type = 'Email Document'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isDocument = 1
isDelivery = 1 # XXX must be removed later - only event is a delivery
# XXX must be removed later - only event is a delivery
isDelivery = ConstantGetter('isDelivery', value=True)
# Declarative security
security = ClassSecurityInfo()
......
......@@ -29,6 +29,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5.Document.Movement import Movement
from Products.ERP5.Document.EmailDocument import EmailDocument
......@@ -103,10 +104,7 @@ class Event(EmailDocument, Movement, AcknowledgeableMixin):
meta_type = 'ERP5 Event'
portal_type = 'Event'
isPortalContent = 1
isRADContent = 1
isDelivery = 1
isMovement = 1
isDelivery = ConstantGetter('isDelivery', value=True)
# Declarative security
security = ClassSecurityInfo()
......
......@@ -74,8 +74,6 @@ class ExtFolder( XMLObject ):
meta_type='ERP5 External Folder'
portal_type='External Folder'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -97,8 +97,6 @@ class ExternalSource(XMLObject, UrlMixIn, UpdateMixIn):
# CMF Type Definition
meta_type = 'ERP5 External Source'
portal_type = 'External Source'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -73,8 +73,6 @@ class File(Document, CMFFile, CachedConvertableMixin):
meta_type = 'ERP5 File'
portal_type = 'File'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -57,4 +57,4 @@ class FirstCausalityMovementGroup(CausalityMovementGroup):
delivery = delivery_movement.getExplanationValue()
if delivery is not None:
delivery_url = delivery.getRelativeUrl()
return delivery_url
\ No newline at end of file
return delivery_url
......@@ -44,8 +44,6 @@ class FloatDivergenceTester(Predicate):
meta_type = 'ERP5 Float Divergence Tester'
portal_type = 'Float Divergence Tester'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -50,8 +50,6 @@ class GeographicAddress(Coordinate, Base):
meta_type = 'ERP5 Geographic Address'
portal_type = 'Address'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -85,8 +85,6 @@ class Image(File, OFSImage):
# CMF Type Definition
meta_type = 'ERP5 Image'
portal_type = 'Image'
isPortalContent = 1
isRADContent = 1
# Default attribute values
width = 0
......
......@@ -60,8 +60,6 @@ class ImmobilisableItem(XMLObject, Amount):
meta_type = 'ERP5 ImmobilisableItem'
portal_type = 'Immobilisable Item'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -41,7 +41,7 @@ from Products.ERP5.Document.Delivery import Delivery
from string import capitalize
from zLOG import LOG
class Immobilisation(XMLObject, Delivery):
class Immobilisation(Delivery, XMLObject):
"""
An Immobilisation object holds the information about
an accounting immobilisation (in order to amortise an object)
......@@ -53,10 +53,6 @@ class Immobilisation(XMLObject, Delivery):
meta_type = 'ERP5 Immobilisation'
portal_type = 'Immobilisation'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isDelivery = 1
isMovement = 0
# Declarative security
security = ClassSecurityInfo()
......
......@@ -46,9 +46,6 @@ class ImmobilisationCell(Movement, XMLObject, ImmobilisationMovement):
meta_type = 'ERP5 Immobilisation Cell'
portal_type = 'Immobilisation Cell'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isMovement = 1
isAccountable = 0 # It should not be indexed in stock table
# Declarative security
......
......@@ -58,8 +58,6 @@ class ImmobilisationDelivery(XMLObject):
meta_type = 'ERP5 Immobilisation Delivery'
portal_type = 'Immobilisation Delivery'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -47,9 +47,6 @@ class ImmobilisationLine(Movement, XMLObject, ImmobilisationMovement, DeliveryLi
meta_type = 'ERP5 Immobilisation Line'
portal_type = 'Immobilisation Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isMovement = 1
isAccountable = 0 # It should not be indexed in stock table
# Declarative security
......
......@@ -76,8 +76,6 @@ class ImmobilisationMovement(Movement, XMLObject):
meta_type = 'ERP5 Immobilisation Movement'
portal_type = 'Immobilisation Movement'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -41,8 +41,6 @@ class IndependentCapacity(Capacity):
meta_type = 'ERP5 Independent Capacity'
portal_type = 'Independent Capacity'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -44,8 +44,6 @@ class InternetProtocolAddress(Base, Coordinate):
meta_type = 'ERP5 Internet Protocol Address'
portal_type = 'Internet Protocol Address'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -28,6 +28,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5.Document.Delivery import Delivery
from Acquisition import aq_base
from zLOG import LOG
......@@ -39,10 +40,7 @@ class Inventory(Delivery):
# CMF Type Definition
meta_type = 'ERP5 Inventory'
portal_type = 'Inventory'
isPortalContent = 1
isRADContent = 1
isDelivery = 1
isInventory = 1
isInventory = ConstantGetter('isInventory', value=True)
# Declarative security
security = ClassSecurityInfo()
......
......@@ -30,6 +30,7 @@ from Acquisition import aq_base
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5.Document.DeliveryCell import DeliveryCell
......@@ -43,10 +44,7 @@ class InventoryCell(DeliveryCell):
meta_type = 'ERP5 Inventory Cell'
portal_type = 'Inventory Cell'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isMovement = 1
isInventoryMovement = 1
isInventoryMovement = ConstantGetter('isInventoryMovement', value=True)
# Declarative security
security = ClassSecurityInfo()
......
......@@ -32,6 +32,7 @@ from Acquisition import aq_base
from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5.Document.DeliveryLine import DeliveryLine
from Products.ERP5.Document.Movement import Movement
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from zLOG import LOG
......@@ -43,9 +44,7 @@ class InventoryLine(DeliveryLine):
meta_type = 'ERP5 Inventory Line'
portal_type = 'Inventory Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isInventoryMovement = 1
isInventoryMovement = ConstantGetter('isInventoryMovement', value=True)
# Declarative security
security = ClassSecurityInfo()
......
......@@ -37,8 +37,6 @@ class Invoice(AccountingTransaction):
meta_type = 'ERP5 Invoice'
portal_type = 'Invoice'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -43,10 +43,7 @@ class InvoiceCell(DeliveryCell):
meta_type = 'ERP5 Invoice Cell'
portal_type = 'Invoice Cell'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isCell = 1
isMovement = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -48,8 +48,6 @@ class InvoiceLine(DeliveryLine):
meta_type = 'ERP5 Invoice Line'
portal_type = 'Invoice Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -44,8 +44,6 @@ class InvoiceRule(DeliveryRule):
meta_type = 'ERP5 Invoice Rule'
portal_type = 'Invoice Rule'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -45,8 +45,6 @@ class InvoiceTransactionRule(Rule, PredicateMatrix):
meta_type = 'ERP5 Invoice Transaction Rule'
portal_type = 'Invoice Transaction Rule'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -42,8 +42,6 @@ class InvoicingRule(Rule):
meta_type = 'ERP5 Invoicing Rule'
portal_type = 'Invoicing Rule'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -57,8 +57,6 @@ class Item(XMLObject, Amount, ImmobilisableItem):
meta_type = 'ERP5 Item'
portal_type = 'Item'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -40,8 +40,6 @@ class Machine(Item):
meta_type = 'ERP5 Machine'
portal_type = 'Machine'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......@@ -55,8 +55,6 @@ class MailMessage(Event):
meta_type = 'ERP5 Mail Message'
portal_type = 'Mail Message'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -58,8 +58,6 @@ class MappedValue(Predicate, Amount):
meta_type = 'ERP5 Mapped Value'
portal_type = 'Mapped Value'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -42,8 +42,6 @@ class MetaNode(Node):
meta_type = 'ERP5 MetaNode'
portal_type = 'MetaNode'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -41,8 +41,6 @@ class MetaResource(Resource):
meta_type = 'ERP5 MetaResource'
portal_type = 'MetaResource'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -175,9 +175,6 @@ class Movement(XMLObject, Amount):
meta_type = 'ERP5 Movement'
portal_type = 'Movement'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isMovement = 1
# Declarative security
security = ClassSecurityInfo()
......@@ -198,6 +195,10 @@ class Movement(XMLObject, Amount):
, PropertySheet.Price
)
security.declareProtected(Permissions.AccessContentsInformation, 'isMovement')
def isMovement(self):
return 1
# Pricing methods
# _getPrice is defined in the order / delivery
# Pricing mehod
......
......@@ -77,8 +77,6 @@ class NodeBudgetVariation(BudgetVariation):
meta_type = 'ERP5 Node Budget Variation'
portal_type = 'Node Budget Variation'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -31,6 +31,7 @@ from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5.Document.Delivery import Delivery
class OpenOrder(Delivery):
......@@ -39,7 +40,7 @@ class OpenOrder(Delivery):
"""
meta_type = 'ERP5 Open Order'
portal_type = 'Open Order'
isPredicate = 1 # XXX - Why ?
isPredicate = ConstantGetter('isPredicate', value=True) # XXX - Why ?
# Declarative security
security = ClassSecurityInfo()
......
......@@ -39,8 +39,6 @@ class OpenOrderCell(SupplyCell):
meta_type = 'ERP5 Open Order Cell'
portal_type = 'Open Order Cell'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -40,9 +40,6 @@ class OpenOrderLine(SupplyLine):
meta_type = 'ERP5 Open Order Line'
portal_type = 'Open Order Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isPredicate = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -41,7 +41,6 @@ class Order(Delivery):
# CMF Type Definition
meta_type = 'ERP5 Order'
portal_type = 'Order'
isDelivery = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -54,8 +54,6 @@ class Organisation(XMLObject):
meta_type = 'ERP5 Organisation'
portal_type = 'Organisation'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -49,8 +49,6 @@ class PDFDocument(Image, CachedConvertableMixin):
# CMF Type Definition
meta_type = 'ERP5 PDF Document'
portal_type = 'PDF'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -40,8 +40,6 @@ class PDFTypeInformation(ERP5TypeInformation):
# CMF Type Definition
meta_type = 'ERP5 PDF Type Information'
portal_type = 'PDF Type'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -63,7 +63,6 @@ class PackingList(Delivery):
meta_type = 'ERP5 Packing List'
portal_type = 'Packing List'
add_permission = Permissions.AddPortalContent
isDelivery = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -50,8 +50,6 @@ class Path(MappedValue):
meta_type = 'ERP5 Path'
portal_type = 'Path'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -39,10 +39,7 @@ class PaySheetCell(InvoiceCell):
meta_type = 'ERP5 Pay Sheet Cell'
portal_type = 'Pay Sheet Cell'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
isCell = 1
isMovement = 1
# Declarative security
security = ClassSecurityInfo()
......
......@@ -42,8 +42,6 @@ class PaySheetLine(InvoiceLine):
meta_type = 'ERP5 Pay Sheet Line'
portal_type = 'Pay Sheet Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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