Commit 350d96ed authored by Nicolas Delaby's avatar Nicolas Delaby

remove spaces

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19670 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8708e6f8
......@@ -44,17 +44,10 @@ from Products.CMFCore.utils import getToolByName
from Products.PythonScripts.Utility import allow_class
from Products.ERP5.Document.ImmobilisationMovement import UNIMMOBILISING_METHOD, NO_CHANGE_METHOD, AMORTISATION_METHOD_PREFIX
from Products.ERP5.Document.ImmobilisationMovement import IMMOBILISATION_NEEDED_PROPERTY_LIST, IMMOBILISATION_UNCONTINUOUS_NEEDED_PROPERTY_LIST, IMMOBILISATION_FACULTATIVE_PROPERTY_LIST
from zLOG import LOG
NEGLIGEABLE_PRICE = 10e-8
#class ImmobilisationValidityError(Exception): pass
#class ImmobilisationCalculationError(Exception): pass
#allow_class(ImmobilisationValidityError)
#allow_class(ImmobilisationCalculationError)
from Products.ERP5Type.Errors import ImmobilisationValidityError, ImmobilisationCalculationError
class ImmobilisableItem(XMLObject, Amount):
......@@ -84,6 +77,7 @@ class ImmobilisableItem(XMLObject, Amount):
, PropertySheet.Reference
, PropertySheet.Amortisation
)
security.declareProtected(Permissions.View, 'getImmobilisationRelatedMovementList')
def getImmobilisationRelatedMovementList(self,
from_date = None,
......@@ -157,7 +151,6 @@ class ImmobilisableItem(XMLObject, Amount):
immo_list.append(movement)
return immo_list
def _ownerChange(self, first_section, second_section):
"""
Tests if section 1 and section 2 are the same owner or not
......@@ -182,7 +175,6 @@ class ImmobilisableItem(XMLObject, Amount):
return 0
return 1
def _getFirstIndependantOrganisation(self, section):
"""
Returns the first found independant organisation, looking at
......@@ -216,7 +208,6 @@ class ImmobilisableItem(XMLObject, Amount):
return None
return organisation
security.declareProtected(Permissions.View, 'getImmobilisationMovementValueList')
def getImmobilisationMovementValueList(self,
from_date=None,
......@@ -233,7 +224,6 @@ class ImmobilisableItem(XMLObject, Amount):
immobilisation_and_owner_change=1,
**kw)
security.declareProtected(Permissions.View, 'getUnfilteredImmobilisationMovementValueList')
def getUnfilteredImmobilisationMovementValueList(self, from_date=None, to_date=None, **kw):
"""
......@@ -244,7 +234,6 @@ class ImmobilisableItem(XMLObject, Amount):
to_date=to_date,
filter_valid=0, **kw)
security.declareProtected(Permissions.View, 'getPastImmobilisationMovementValueList')
def getPastImmobilisationMovementValueList(self, from_date=None, at_date=None, **kw):
"""
......@@ -256,7 +245,6 @@ class ImmobilisableItem(XMLObject, Amount):
**kw )
return result
security.declareProtected(Permissions.View, 'getFutureImmobilisationMovementValueList')
def getFutureImmobilisationMovementValueList(self, to_date=None, at_date=None, from_movement=None, **kw):
"""
......@@ -283,7 +271,6 @@ class ImmobilisableItem(XMLObject, Amount):
return past_list[-1]
return None
security.declareProtected(Permissions.View, 'getNextImmobilisationMovementValue')
def getNextImmobilisationMovementValue(self, at_date=None, from_movement=None, **kw):
"""
......@@ -298,7 +285,6 @@ class ImmobilisableItem(XMLObject, Amount):
return future_list[0]
return None
security.declareProtected(Permissions.View, 'getImmobilisationPeriodList')
def getImmobilisationPeriodList(self, from_date=None, to_date=None, **kw):
"""
......@@ -311,8 +297,8 @@ class ImmobilisableItem(XMLObject, Amount):
kw_key_list.remove('immo_cache_dict')
immo_cache_dict = kw.get('immo_cache_dict', {'period':{}, 'price':{}})
kw['immo_cache_dict'] = immo_cache_dict
if immo_cache_dict['period'].has_key( (self.getRelativeUrl(), from_date, to_date) +
tuple([(key,kw[key]) for key in kw_key_list]) ) :
if immo_cache_dict['period'].has_key((self.getRelativeUrl(), from_date, to_date) +
tuple([(key,kw[key]) for key in kw_key_list])) :
return immo_cache_dict['period'][ (self.getRelativeUrl(), from_date, to_date) +
tuple( [(key,kw[key]) for key in kw_key_list]) ]
def setPreviousPeriodParameters(period_list,
......@@ -600,13 +586,11 @@ class ImmobilisableItem(XMLObject, Amount):
return 0
return 1
security.declareProtected(Permissions.View, 'getCurrentRemainingAmortisationDuration')
def getCurrentRemainingAmortisationDuration(self, **kw):
""" Returns the calculated remaining amortisation duration for this item at the current time. """
return self.getRemainingAmortisationDuration(at_date = DateTime(), **kw)
security.declareProtected(Permissions.View, 'getRemainingAmortisationDuration')
def getRemainingAmortisationDuration(self, at_date=None, **kw):
"""
......@@ -636,7 +620,6 @@ class ImmobilisableItem(XMLObject, Amount):
return int(remaining_duration)
return None
security.declareProtected(Permissions.View, 'getRemainingDurability')
def getRemainingDurability(self, at_date=None, **kw):
"""
......@@ -677,7 +660,7 @@ class ImmobilisableItem(XMLObject, Amount):
start_durability = immo_period['start_durability']
if start_durability is None:
start_durability = self.getRemainingDurability(at_date=start_date,
immo_cache_dict=kw.get('immo_cache_dict', {}))
immo_cache_dict=kw.get('immo_cache_dict', {'period':{},'price':{}}))
if start_durability is None:
return None
stop_date = None
......@@ -953,7 +936,6 @@ class ImmobilisableItem(XMLObject, Amount):
return '%0.2f %s' % (returned_price, currency)
return returned_price
security.declareProtected(Permissions.View, 'getCurrentAmortisationPrice')
def getCurrentAmortisationPrice(self, with_currency=0, **kw):
""" Returns the deprecated value of item at current time """
......@@ -1068,7 +1050,6 @@ class ImmobilisableItem(XMLObject, Amount):
movement_list.append(movement)
return movement_list
security.declareProtected(Permissions.View, 'getSectionChangeList')
def getSectionChangeList(self, at_date=None, **kw):
"""
......@@ -1099,7 +1080,6 @@ class ImmobilisableItem(XMLObject, Amount):
owner_list.append( {'owner' : owner, 'date' : movement.getStopDate(), 'movement':movement } )
return owner_list
security.declareProtected(Permissions.View, 'getSectionValue')
def getSectionValue(self, at_date=None, **kw):
"""
......
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