Commit 01872342 authored by Jean-Paul Smets's avatar Jean-Paul Smets

New Predicate API


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3274 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cf11d044
......@@ -31,7 +31,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.PredicateGroup import PredicateGroup as Predicate
from Products.ERP5.Document.Predicate import Predicate
from Products.ERP5.Document.Invoice import Invoice
class AccountingRuleCell(Predicate, Invoice):
......
......@@ -194,9 +194,9 @@ Une ligne tarifaire."""
"""
return self.getStopDate()
# SKU vs. CU
security.declareProtected(Permissions.AccessContentsInformation, 'getSourceStandardInventoriatedQuantity')
def getSourceStandardInventoriatedQuantity(self):
# Pricing in standard currency
security.declareProtected(Permissions.AccessContentsInformation, 'getPrice')
def getPrice(self):
"""
The inventoriated quantity converted in a default unit
......@@ -211,24 +211,5 @@ Une ligne tarifaire."""
if source is not None and resource is not None:
return resource.convertCurrency(result, source.getPriceCurrencyValue())
return None
security.declareProtected(Permissions.AccessContentsInformation, 'getDestinationStandardInventoriatedQuantity')
def getDestinationStandardInventoriatedQuantity(self):
"""
The inventoriated quantity converted in a default unit
For assortments, returns the inventoriated quantity in terms of number of items
in the assortemnt.
For accounting, returns the quantity converted in a default unit
"""
result = self.getInventoriatedQuantity()
resource = self.getResourceValue()
destination = self.getSourceValue()
if destination is not None and resource is not None:
return resource.convertCurrency(result, destination.getPriceCurrencyValue())
return None
\ No newline at end of file
......@@ -29,11 +29,11 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Amount import Amount
from Products.ERP5.Document.SetMappedValue import SetMappedValue
from Products.ERP5.Document.MappedValue import MappedValue
from zLOG import LOG
class AmountFilter(SetMappedValue, Amount):
class AmountFilter(MappedValue, Amount):
"""
An AmountFilter allows to define last minute
changes in a transformation. For example: different
......
......@@ -32,12 +32,12 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5.Document.MetaNode import MetaNode
from Products.ERP5.Document.MetaResource import MetaResource
from Products.ERP5Type import Interface, Permissions, PropertySheet
from Products.ERP5.Document.PredicateGroup import PredicateGroup
from Products.ERP5.Document.Predicate import Predicate
from zLOG import LOG
class Category(CMFCategory, PredicateGroup, MetaNode, MetaResource):
class Category(CMFCategory, Predicate, MetaNode, MetaResource):
"""
Category objects allow to define classification categories
in an ERP5 portal. For example, a document may be assigned a color
......@@ -106,5 +106,7 @@ class Category(CMFCategory, PredicateGroup, MetaNode, MetaResource):
)
property_sheets = ( PropertySheet.Base
, PropertySheet.SimpleItem )
, PropertySheet.SimpleItem
, PropertySheet.CategoryCore )
......@@ -31,9 +31,9 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.PredicateGroup import PredicateGroup
from Products.ERP5.Document.Predicate import Predicate
class Domain(PredicateGroup):
class Domain(Predicate):
"""
An abstract class subclassed by reports and mapped values
......
......@@ -49,6 +49,11 @@ class MappedValue(Domain, Amount):
MappedValue.
XXX - Amount should be remove from here
Interesting Idea: properties and categories of the mapped value
(not of the predicate) could be handled through additional matrix
dimensions rather than through ad-hoc definition.
"""
meta_type = 'ERP5 Mapped Value'
portal_type = 'Mapped Value'
......
This diff is collapsed.
......@@ -34,9 +34,9 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5Type.XMLMatrix import XMLMatrix
from Products.ERP5.Document.Resource import Resource
from Products.ERP5.Document.SetMappedValue import SetMappedValue
from Products.ERP5.Document.MappedValue import MappedValue
class SetPricing(SetMappedValue, XMLMatrix):
class SetPricing(MappedValue, XMLMatrix):
"""
Un element de tarif est un prix pour un ensemble de conditions d'application...
"""
......
......@@ -34,9 +34,9 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.DeliveryCell import DeliveryCell
from Products.ERP5.Document.Path import Path
from Products.ERP5.Document.PredicateGroup import PredicateGroup
from Products.ERP5.Document.Predicate import Predicate
class SupplyCell(PredicateGroup, DeliveryCell, Path):
class SupplyCell(Predicate, DeliveryCell, Path):
"""
A DeliveryCell allows to define specific quantities
for each variation of a resource in a delivery line.
......
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