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