Commit 6e9fde83 authored by Nicolas Delaby's avatar Nicolas Delaby

Small changes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12041 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 14660105
...@@ -30,7 +30,7 @@ from Globals import InitializeClass ...@@ -30,7 +30,7 @@ from Globals import InitializeClass
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Base, Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Base, Permissions, PropertySheet, Constraint, Interface
#from Products.ERP5.Core import MetaNode, MetaResource from Products.ERP5.Core import MetaNode, MetaResource
from Products.CMFCore.WorkflowCore import WorkflowMethod from Products.CMFCore.WorkflowCore import WorkflowMethod
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
...@@ -109,7 +109,6 @@ class ImmobilisationMovement(Movement, XMLObject): ...@@ -109,7 +109,6 @@ class ImmobilisationMovement(Movement, XMLObject):
If to_translate is set, the method may return a dictionary {'msg':'...', 'mapping':{} } If to_translate is set, the method may return a dictionary {'msg':'...', 'mapping':{} }
""" """
relative_url = self.getRelativeUrl() relative_url = self.getRelativeUrl()
def checkValuesAreNotNone(property_list): def checkValuesAreNotNone(property_list):
errors = [] errors = []
for key, value, name in property_list: for key, value, name in property_list:
...@@ -178,6 +177,7 @@ class ImmobilisationMovement(Movement, XMLObject): ...@@ -178,6 +177,7 @@ class ImmobilisationMovement(Movement, XMLObject):
return errors return errors
item_list = self.getAggregateValueList() item_list = self.getAggregateValueList()
if len(item_list) == 0: if len(item_list) == 0:
# No item aggregated, so the movement is considered as valid # No item aggregated, so the movement is considered as valid
#errors.append([self.getRelativeUrl(), #errors.append([self.getRelativeUrl(),
...@@ -189,9 +189,12 @@ class ImmobilisationMovement(Movement, XMLObject): ...@@ -189,9 +189,12 @@ class ImmobilisationMovement(Movement, XMLObject):
check_uncontinuous = 0 check_uncontinuous = 0
if self.getStopDate() is not None: if self.getStopDate() is not None:
if method not in [None, "", NO_CHANGE_METHOD, UNIMMOBILISING_METHOD]: if method not in [None, "", NO_CHANGE_METHOD, UNIMMOBILISING_METHOD]:
continuous = self.getAmortisationMethodParameter("continuous")["continuous"] get_amo_method_parameter = self.getAmortisationMethodParameter("continuous")
continuous = get_amo_method_parameter["continuous"]
if not continuous: if not continuous:
check_uncontinuous = 1 check_uncontinuous = 1
# We need to check if the preceding movement is in the same period, and valid
# This check must be done on each item
else: else:
# We need to check if the preceding movement is in the same period, and if it is valid # We need to check if the preceding movement is in the same period, and if it is valid
# This check must be done on each item # This check must be done on each item
...@@ -270,7 +273,7 @@ class ImmobilisationMovement(Movement, XMLObject): ...@@ -270,7 +273,7 @@ class ImmobilisationMovement(Movement, XMLObject):
parameter_dict[parameter] = None parameter_dict[parameter] = None
amortisation_method = self.getActualAmortisationMethodForItem(item, **kw) amortisation_method = self.getActualAmortisationMethodForItem(item, **kw)
if amortisation_method not in (None, NO_CHANGE_METHOD, UNIMMOBILISING_METHOD, ""): if amortisation_method not in (None, NO_CHANGE_METHOD, UNIMMOBILISING_METHOD, ""):
parameter_object = self.unrestrictedTraverse(AMORTISATION_METHOD_PREFIX + amortisation_method) parameter_object = self.getPortalObject().unrestrictedTraverse(AMORTISATION_METHOD_PREFIX + amortisation_method)
if parameter_object is not None: if parameter_object is not None:
for parameter in parameter_list: for parameter in parameter_list:
parameter_dict[parameter] = getattr(parameter_object, parameter, None) parameter_dict[parameter] = getattr(parameter_object, parameter, None)
...@@ -298,7 +301,6 @@ class ImmobilisationMovement(Movement, XMLObject): ...@@ -298,7 +301,6 @@ class ImmobilisationMovement(Movement, XMLObject):
new_param_list.append(param) new_param_list.append(param)
new_parameter_dict[key] = new_param_list new_parameter_dict[key] = new_param_list
parameter_dict = new_parameter_dict parameter_dict = new_parameter_dict
return parameter_dict return parameter_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