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
...@@ -167,7 +160,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -167,7 +160,7 @@ class ImmobilisableItem(XMLObject, Amount):
""" """
if first_section == second_section: if first_section == second_section:
return 0 return 0
first_section = self._getFirstIndependantOrganisation(first_section) first_section = self._getFirstIndependantOrganisation(first_section)
second_section = self._getFirstIndependantOrganisation(second_section) second_section = self._getFirstIndependantOrganisation(second_section)
if first_section is None: if first_section is None:
...@@ -181,8 +174,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -181,8 +174,7 @@ class ImmobilisableItem(XMLObject, Amount):
if first_section == second_section: if first_section == second_section:
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
...@@ -215,7 +207,6 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -215,7 +207,6 @@ class ImmobilisableItem(XMLObject, Amount):
else: else:
return None return None
return organisation return organisation
security.declareProtected(Permissions.View, 'getImmobilisationMovementValueList') security.declareProtected(Permissions.View, 'getImmobilisationMovementValueList')
def getImmobilisationMovementValueList(self, def getImmobilisationMovementValueList(self,
...@@ -232,8 +223,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -232,8 +223,7 @@ class ImmobilisableItem(XMLObject, Amount):
filter_valid=filter_valid, filter_valid=filter_valid,
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):
""" """
...@@ -297,8 +284,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -297,8 +284,7 @@ class ImmobilisableItem(XMLObject, Amount):
if len(future_list) > 0: if len(future_list) > 0:
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,
...@@ -330,7 +316,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -330,7 +316,7 @@ class ImmobilisableItem(XMLObject, Amount):
for key in keys: for key in keys:
current_period[key] = previous_period[key] current_period[key] = previous_period[key]
##### #####
# We need to separate immobilisation treatment from section_change movements treatment # We need to separate immobilisation treatment from section_change movements treatment
# An immobilisation is a movement which contains immobilisation data and MAY change the section # An immobilisation is a movement which contains immobilisation data and MAY change the section
# A section change movement DOES NOT contain immobilisation data # A section change movement DOES NOT contain immobilisation data
...@@ -381,7 +367,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -381,7 +367,7 @@ class ImmobilisableItem(XMLObject, Amount):
immobilisation = immobilisation_list[immo_cursor] immobilisation = immobilisation_list[immo_cursor]
if section_cursor < len(section_movement_list): if section_cursor < len(section_movement_list):
section_movement = section_movement_list[section_cursor] section_movement = section_movement_list[section_cursor]
if (immobilisation is not None) and (section_movement is None or \ if (immobilisation is not None) and (section_movement is None or \
section_movement.getStopDate() > immobilisation.getStopDate()): section_movement.getStopDate() > immobilisation.getStopDate()):
# immobilisation treatment # immobilisation treatment
...@@ -421,7 +407,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -421,7 +407,7 @@ class ImmobilisableItem(XMLObject, Amount):
immo_period_list.append(current_immo_period) immo_period_list.append(current_immo_period)
current_immo_period = {} current_immo_period = {}
current_immo_period = {} current_immo_period = {}
# Then open the new one # Then open the new one
if open_new_period and method != UNIMMOBILISING_METHOD: if open_new_period and method != UNIMMOBILISING_METHOD:
# First check if there is a valid owner in this period # First check if there is a valid owner in this period
...@@ -459,11 +445,11 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -459,11 +445,11 @@ class ImmobilisableItem(XMLObject, Amount):
current_immo_period['start_vat'] = 0 current_immo_period['start_vat'] = 0
current_immo_period['start_extra_cost_price'] = 0 current_immo_period['start_extra_cost_price'] = 0
current_immo_period['start_main_price'] = self.getAmortisationPrice(at_date=movement.getStopDate(), current_immo_period['start_main_price'] = self.getAmortisationPrice(at_date=movement.getStopDate(),
immo_cache_dict=immo_cache_dict) immo_cache_dict=immo_cache_dict)
current_immo_period['start_duration'] = self.getRemainingAmortisationDuration(at_date=movement.getStopDate(), current_immo_period['start_duration'] = self.getRemainingAmortisationDuration(at_date=movement.getStopDate(),
immo_cache_dict=immo_cache_dict) immo_cache_dict=immo_cache_dict)
current_immo_period['start_durability'] = self.getRemainingDurability(at_date=movement.getStopDate(), current_immo_period['start_durability'] = self.getRemainingDurability(at_date=movement.getStopDate(),
immo_cache_dict=immo_cache_dict) immo_cache_dict=immo_cache_dict)
method = current_immo_period.get('start_method', "") method = current_immo_period.get('start_method', "")
# For both types of movement, set some properties # For both types of movement, set some properties
extra_cost_price = current_immo_period.get('start_extra_cost_price') extra_cost_price = current_immo_period.get('start_extra_cost_price')
...@@ -500,7 +486,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -500,7 +486,7 @@ class ImmobilisableItem(XMLObject, Amount):
) )
current_immo_period['continuous'] = continuous current_immo_period['continuous'] = continuous
current_immo_period['adjacent'] = adjacent current_immo_period['adjacent'] = adjacent
if continuous: if continuous:
# A continuous period gets 'initial' data from previous period. # A continuous period gets 'initial' data from previous period.
setPreviousPeriodParameters(immo_period_list, current_immo_period) setPreviousPeriodParameters(immo_period_list, current_immo_period)
...@@ -546,7 +532,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -546,7 +532,7 @@ class ImmobilisableItem(XMLObject, Amount):
for key, value, tag in needed_property_list: for key, value, tag in needed_property_list:
if current_immo_period.get('initial_%s' % key) in (None,"",NO_CHANGE_METHOD): if current_immo_period.get('initial_%s' % key) in (None,"",NO_CHANGE_METHOD):
current_immo_period = {} current_immo_period = {}
if current_immo_period not in (None,{}): if current_immo_period not in (None,{}):
immo_period_list.append(current_immo_period) immo_period_list.append(current_immo_period)
# Round dates since immobilisation calculation is made on days # Round dates since immobilisation calculation is made on days
...@@ -599,14 +585,12 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -599,14 +585,12 @@ class ImmobilisableItem(XMLObject, Amount):
# It means the latest period is terminated before the current date # It means the latest period is terminated before the current date
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):
""" """
...@@ -635,8 +619,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -635,8 +619,7 @@ class ImmobilisableItem(XMLObject, Amount):
returned_value = 0 returned_value = 0
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):
""" """
...@@ -647,14 +630,14 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -647,14 +630,14 @@ class ImmobilisableItem(XMLObject, Amount):
Each Immobilisation Movement stores the durability at a given time, so it is possible Each Immobilisation Movement stores the durability at a given time, so it is possible
to approximate the durability between two Immobilisation Movements by using a simple to approximate the durability between two Immobilisation Movements by using a simple
linear calculation. linear calculation.
Note that durability has no sense for items which are immobilisated but not Note that durability has no sense for items which are immobilisated but not
amortised (like grounds, etc...). Calculation is based on duration, so an item amortised (like grounds, etc...). Calculation is based on duration, so an item
immobilised without amortisation duration will not decrease its durability. immobilised without amortisation duration will not decrease its durability.
""" """
if at_date is None: if at_date is None:
at_date = DateTime() at_date = DateTime()
immo_period_list = kw.get('immo_period_list', None) immo_period_list = kw.get('immo_period_list', None)
new_kw = dict(kw) new_kw = dict(kw)
if new_kw.has_key('to_date'): if new_kw.has_key('to_date'):
...@@ -666,18 +649,18 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -666,18 +649,18 @@ class ImmobilisableItem(XMLObject, Amount):
# First case : no data about immobilisation # First case : no data about immobilisation
if len(immo_period_list) == 0: if len(immo_period_list) == 0:
return None return None
immo_period = immo_period_list[-1] immo_period = immo_period_list[-1]
# Second case : the item is not currently immobilised # Second case : the item is not currently immobilised
if immo_period.has_key('stop_date'): if immo_period.has_key('stop_date'):
return immo_period['stop_durability'] return immo_period['stop_durability']
# Third case : the item is currently immobilised # Third case : the item is currently immobilised
start_date = immo_period['start_date'] start_date = immo_period['start_date']
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
...@@ -704,7 +687,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -704,7 +687,7 @@ class ImmobilisableItem(XMLObject, Amount):
return start_durability return start_durability
else: else:
return start_durability - consumpted_durability * current_consumpted_time / consumpted_time return start_durability - consumpted_durability * current_consumpted_time / consumpted_time
security.declareProtected(Permissions.View, 'getCurrentRemainingDurability') security.declareProtected(Permissions.View, 'getCurrentRemainingDurability')
def getCurrentRemainingDurability(self, **kw): def getCurrentRemainingDurability(self, **kw):
...@@ -712,7 +695,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -712,7 +695,7 @@ class ImmobilisableItem(XMLObject, Amount):
Returns the remaining durability at the current date Returns the remaining durability at the current date
""" """
return self.getRemainingDurability(at_date = DateTime(), **kw) return self.getRemainingDurability(at_date = DateTime(), **kw)
security.declareProtected(Permissions.View, 'getAmortisationPrice') security.declareProtected(Permissions.View, 'getAmortisationPrice')
def getAmortisationPrice(self, at_date=None, with_currency=0, **kw): def getAmortisationPrice(self, at_date=None, with_currency=0, **kw):
...@@ -720,17 +703,17 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -720,17 +703,17 @@ class ImmobilisableItem(XMLObject, Amount):
Returns the deprecated value of item at given date, or now. Returns the deprecated value of item at given date, or now.
If with_currency is set, returns a string containing the value and the corresponding currency. If with_currency is set, returns a string containing the value and the corresponding currency.
""" """
if at_date is None: if at_date is None:
at_date = DateTime() at_date = DateTime()
kw_key_list = kw.keys() kw_key_list = kw.keys()
kw_key_list.sort() kw_key_list.sort()
if kw_key_list.count('immo_cache_dict'): if kw_key_list.count('immo_cache_dict'):
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['price'].has_key( (self.getRelativeUrl(), at_date) + if immo_cache_dict['price'].has_key( (self.getRelativeUrl(), at_date) +
tuple([(key,kw[key]) for key in kw_key_list]) ) : tuple([(key,kw[key]) for key in kw_key_list]) ) :
returned_price = immo_cache_dict['price'][ (self.getRelativeUrl(), at_date) + returned_price = immo_cache_dict['price'][ (self.getRelativeUrl(), at_date) +
...@@ -738,14 +721,14 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -738,14 +721,14 @@ class ImmobilisableItem(XMLObject, Amount):
if with_currency: if with_currency:
return '%0.2f %s' % (returned_price, currency) return '%0.2f %s' % (returned_price, currency)
return returned_price return returned_price
immo_period_list = self.getImmobilisationPeriodList(to_date=at_date, **kw) immo_period_list = self.getImmobilisationPeriodList(to_date=at_date, **kw)
if len(immo_period_list) == 0: if len(immo_period_list) == 0:
# Item has never been immobilised. We cannot get its price # Item has never been immobilised. We cannot get its price
if with_currency: if with_currency:
return "N/A" return "N/A"
return None return None
# Get data from the last immo period # Get data from the last immo period
immo_period = immo_period_list[-1] immo_period = immo_period_list[-1]
initial_movement = immo_period['initial_movement'] initial_movement = immo_period['initial_movement']
...@@ -787,13 +770,13 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -787,13 +770,13 @@ class ImmobilisableItem(XMLObject, Amount):
stop_durability = self.getRemainingDurability(at_date = period_stop_date, stop_durability = self.getRemainingDurability(at_date = period_stop_date,
immo_period_list=immo_period_list, immo_period_list=immo_period_list,
immo_cache_dict=immo_cache_dict) immo_cache_dict=immo_cache_dict)
section = owner section = owner
currency = owner.getPriceCurrency() currency = owner.getPriceCurrency()
depreciable_price = period_start_price - disposal_price depreciable_price = period_start_price - disposal_price
financial_date = section.getFinancialYearStopDate() financial_date = section.getFinancialYearStopDate()
amortisation_method = AMORTISATION_METHOD_PREFIX + immo_period['initial_method'] amortisation_method = AMORTISATION_METHOD_PREFIX + immo_period['initial_method']
# Get the amortisation method parameters # Get the amortisation method parameters
amortisation_parameters = initial_movement.getAmortisationMethodParameterForItem( amortisation_parameters = initial_movement.getAmortisationMethodParameterForItem(
item=self, parameter_list = [ item=self, parameter_list = [
...@@ -952,7 +935,6 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -952,7 +935,6 @@ class ImmobilisableItem(XMLObject, Amount):
if with_currency: if with_currency:
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):
...@@ -972,7 +954,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -972,7 +954,7 @@ class ImmobilisableItem(XMLObject, Amount):
specialise_value = applied_rule.getSpecialiseValue() specialise_value = applied_rule.getSpecialiseValue()
if specialise_value is not None and specialise_value.getPortalType() == "Amortisation Rule": if specialise_value is not None and specialise_value.getPortalType() == "Amortisation Rule":
my_applied_rule_list.append(applied_rule) my_applied_rule_list.append(applied_rule)
if len(my_applied_rule_list) == 0: if len(my_applied_rule_list) == 0:
# Create a new applied order rule (portal_rules.order_rule) # Create a new applied order rule (portal_rules.order_rule)
portal_rules = getToolByName(self, 'portal_rules') portal_rules = getToolByName(self, 'portal_rules')
...@@ -1067,8 +1049,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -1067,8 +1049,7 @@ class ImmobilisableItem(XMLObject, Amount):
if len(movement_list)==0 or movement_list[-1] != movement: if len(movement_list)==0 or movement_list[-1] != movement:
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):
""" """
...@@ -1118,7 +1098,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -1118,7 +1098,7 @@ class ImmobilisableItem(XMLObject, Amount):
Return the current owner of the item Return the current owner of the item
""" """
return self.getSectionValue(at_date = DateTime(), **kw) return self.getSectionValue(at_date = DateTime(), **kw)
security.declareProtected(Permissions.View, 'getCleanSqlDict') security.declareProtected(Permissions.View, 'getCleanSqlDict')
def getCleanSqlDict(self, kw): def getCleanSqlDict(self, kw):
no_sql_list = ['immo_cache_dict'] no_sql_list = ['immo_cache_dict']
......
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