diff --git a/product/ERP5/Document/Organisation.py b/product/ERP5/Document/Organisation.py index 7d6e895e1dc883f1e13511d4be851fd88ca8d293..4129ef87f7806874e98e7161bbe17d2cd19c2d0e 100644 --- a/product/ERP5/Document/Organisation.py +++ b/product/ERP5/Document/Organisation.py @@ -26,6 +26,7 @@ # ############################################################################## +import zope.interface from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces @@ -55,6 +56,8 @@ class Organisation(XMLObject): portal_type = 'Organisation' add_permission = Permissions.AddPortalContent + zope.interface.implements(interfaces.INode) + # Declarative security security = ClassSecurityInfo() security.declareObjectProtected(Permissions.AccessContentsInformation) diff --git a/product/ERP5/Document/Person.py b/product/ERP5/Document/Person.py index c2fd85d2f56395e262b915a803feb117d3f5ac53..0cbb20ee36224c168af30e2bb810bdd37468d67e 100644 --- a/product/ERP5/Document/Person.py +++ b/product/ERP5/Document/Person.py @@ -27,6 +27,7 @@ # ############################################################################## +import zope.interface from AccessControl import ClassSecurityInfo from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import _checkPermission @@ -79,6 +80,8 @@ class Person(XMLObject): portal_type = 'Person' add_permission = Permissions.AddPortalContent + zope.interface.implements(interfaces.INode) + # Declarative security security = ClassSecurityInfo() security.declareObjectProtected(Permissions.AccessContentsInformation) diff --git a/product/ERP5/Document/Project.py b/product/ERP5/Document/Project.py index 5a379faf43a7b43dcc02710ca33f59c9f1203736..c4224435e7ac8e572109f30de044d81c54c3f9c5 100644 --- a/product/ERP5/Document/Project.py +++ b/product/ERP5/Document/Project.py @@ -1,7 +1,10 @@ +# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2002 nSight SAS and Contributors. All Rights Reserved. # Nicolas Lhoir <nicolas.lhoir@nsight.fr> +# 2010 Nexedi SA and Contributors. All Rights Reserved. +# J茅rome Perrin <jerome@nexedi.com> # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential @@ -26,11 +29,14 @@ # ############################################################################## +import zope.interface from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces -from Products.ERP5.Document.Order import Order +from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter +from Products.ERP5Type.XMLObject import XMLObject +from Products.ERP5Type.XMLMatrix import XMLMatrix -class Project(Order): +class Project(XMLObject, XMLMatrix): """ Project is a class which describes a typical project in consulting firm. A project has a client, an invoiced client. A project has also a start @@ -39,14 +45,15 @@ class Project(Order): Each task has a person to perform it, a certain amount of time, a date, a place, a description. For each person and each task, there is dedicated time rate. - - XXX Project should not inherit from Order since Task exists. - This is not a Delivery """ meta_type = 'ERP5 Project' portal_type = 'Project' add_permission = Permissions.AddPortalContent + # XXX to index start_date and stop_date in delivery table: + isDelivery = ConstantGetter('isDelivery', value=True) + + zope.interface.implements(interfaces.INode) # Declarative security security = ClassSecurityInfo() diff --git a/product/ERP5/Document/Ticket.py b/product/ERP5/Document/Ticket.py index 83844cde5a86add9a27b9598cf282253937ee0f4..fff6c730a8d2035900059db3d8db29f858ca0bbc 100644 --- a/product/ERP5/Document/Ticket.py +++ b/product/ERP5/Document/Ticket.py @@ -78,9 +78,6 @@ class Ticket(Movement, Project): security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable') def isAccountable(self): - """ - Returns 1 if this needs to be accounted - Only account movements which are not associated to a delivery - Whenever delivery is there, delivery has priority + """ Tickets are accountable. """ return 1 diff --git a/product/ERP5/interfaces/node.py b/product/ERP5/interfaces/node.py new file mode 100644 index 0000000000000000000000000000000000000000..0a0f1d0108dd555a42c2e112123664a74d30899d --- /dev/null +++ b/product/ERP5/interfaces/node.py @@ -0,0 +1,41 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## +""" +Products.ERP5.interfaces.node +""" + +from zope.interface import Interface + +class INode(Interface): + """ Node Interface. + + A node is a place which can receive amounts of resources and send amounts of + resources. Nodes can relate to physical entities (ex. a workshop which + receives raw material, processes it and sends it) or abstract entities (ex. a + bank account which can receive money). Stocks are a kind of Node. + """ +