[Erp5-report] r32317 jerome - in /erp5/trunk/products/ERP5: Document/ interfaces/
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Feb 8 15:26:34 CET 2010
Author: jerome
Date: Mon Feb 8 15:26:31 2010
New Revision: 32317
URL: http://svn.erp5.org?rev=32317&view=rev
Log:
Fix class hierarchy for Project, it should not be an Order, as it is a Node.
Inherit from XMLMatrix, it can be required for project implementations to use matrix for project.
Create INode interface and associate it to common node classes.
Update a few docstrings.
Added:
erp5/trunk/products/ERP5/interfaces/node.py
Modified:
erp5/trunk/products/ERP5/Document/Organisation.py
erp5/trunk/products/ERP5/Document/Person.py
erp5/trunk/products/ERP5/Document/Project.py
erp5/trunk/products/ERP5/Document/Ticket.py
Modified: erp5/trunk/products/ERP5/Document/Organisation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Organisation.py?rev=32317&r1=32316&r2=32317&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Organisation.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Organisation.py [utf8] Mon Feb 8 15:26:31 2010
@@ -26,6 +26,7 @@
#
##############################################################################
+import zope.interface
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
@@ -55,6 +56,8 @@
portal_type = 'Organisation'
add_permission = Permissions.AddPortalContent
+ zope.interface.implements(interfaces.INode)
+
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
Modified: erp5/trunk/products/ERP5/Document/Person.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Person.py?rev=32317&r1=32316&r2=32317&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Person.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Person.py [utf8] Mon Feb 8 15:26:31 2010
@@ -27,6 +27,7 @@
#
##############################################################################
+import zope.interface
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.utils import _checkPermission
@@ -78,6 +79,8 @@
meta_type = 'ERP5 Person'
portal_type = 'Person'
add_permission = Permissions.AddPortalContent
+
+ zope.interface.implements(interfaces.INode)
# Declarative security
security = ClassSecurityInfo()
Modified: erp5/trunk/products/ERP5/Document/Project.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Project.py?rev=32317&r1=32316&r2=32317&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Project.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Project.py [utf8] Mon Feb 8 15:26:31 2010
@@ -1,7 +1,10 @@
+# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2002 nSight SAS and Contributors. All Rights Reserved.
# Nicolas Lhoir <nicolas.lhoir at nsight.fr>
+# 2010 Nexedi SA and Contributors. All Rights Reserved.
+# Jérome Perrin <jerome at 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 @@
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()
Modified: erp5/trunk/products/ERP5/Document/Ticket.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Ticket.py?rev=32317&r1=32316&r2=32317&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Ticket.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Ticket.py [utf8] Mon Feb 8 15:26:31 2010
@@ -78,9 +78,6 @@
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
Added: erp5/trunk/products/ERP5/interfaces/node.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/node.py?rev=32317&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/node.py (added)
+++ erp5/trunk/products/ERP5/interfaces/node.py [utf8] Mon Feb 8 15:26:31 2010
@@ -1,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.
+ """
+
More information about the Erp5-report
mailing list