diff --git a/product/ERP5/Document/ImmobilisableItem.py b/product/ERP5/Document/ImmobilisableItem.py index 1cc9edbe313d6a9139b07cbda6865907abf00805..97290bf48fe76d1061064704032b1605d8d315f5 100755 --- a/product/ERP5/Document/ImmobilisableItem.py +++ b/product/ERP5/Document/ImmobilisableItem.py @@ -881,20 +881,20 @@ class ImmobilisableItem(XMLObject, Amount): # 'annuity_start_date': annuity_start_date, }) try: - ratio_script = self.unrestrictedTraverse('portal_skins/%s' % amortisation_method).ratioCalculation + ratio_script = self.unrestrictedTraverse(amortisation_method).ratioCalculation except KeyError: LOG('ERP5 Warning :', 0, 'Unable to find the ratio calculation script %s for item %s at date %s' % ( - 'portal_skins/%s/ratioCalculation' % amortisation_method, self.getRelativeUrl(), repr(at_date))) + '%s/ratioCalculation' % amortisation_method, self.getRelativeUrl(), repr(at_date))) raise ImmobilisationCalculationError, \ 'Unable to find the ratio calculation script %s for item %s at date %s' % ( - 'portal_skins/%s/ratioCalculation' % amortisation_method, self.getRelativeUrl(), repr(at_date)) + '%s/ratioCalculation' % amortisation_method, self.getRelativeUrl(), repr(at_date)) current_ratio = ratio_script(**ratio_params) if current_ratio is None: LOG("ERP5 Warning :",0, "Unable to calculate the ratio during the amortisation calculation on item %s at date %s : script %s returned None" % ( - self.getRelativeUrl(), repr(at_date), 'portal_skins/%s/ratioCalculation' % amortisation_method)) + self.getRelativeUrl(), repr(at_date), '%s/ratioCalculation' % amortisation_method)) LOG('params were ', 0, ratio_params) raise ImmobilisationCalculationError, \ "Unable to calculate the ratio during the amortisation calculation on item %s at date %s" % ( diff --git a/product/ERP5/Document/ImmobilisationMovement.py b/product/ERP5/Document/ImmobilisationMovement.py index 0b909f0fa2897b22017b52fc0cf1d0795cd180e7..8b8116a4552ab2166265def28c5db10fd4e924ce 100755 --- a/product/ERP5/Document/ImmobilisationMovement.py +++ b/product/ERP5/Document/ImmobilisationMovement.py @@ -43,7 +43,7 @@ from zLOG import LOG UNIMMOBILISING_METHOD = "unimmobilise" NO_CHANGE_METHOD = "no_change" -AMORTISATION_METHOD_PREFIX = "erp5_accounting_" +AMORTISATION_METHOD_PREFIX = "portal_skins/erp5_accounting_" IMMOBILISATION_NEEDED_PROPERTY_LIST = [ ("date", "stop_date", "Date"), ("method", "amortisation_method", "Amortisation Method"), @@ -270,7 +270,7 @@ class ImmobilisationMovement(Movement, XMLObject): parameter_dict[parameter] = None amortisation_method = self.getActualAmortisationMethodForItem(item, **kw) if amortisation_method not in (None, NO_CHANGE_METHOD, UNIMMOBILISING_METHOD, ""): - parameter_object = self.restrictedTraverse(AMORTISATION_METHOD_PREFIX + amortisation_method) + parameter_object = self.unrestrictedTraverse(AMORTISATION_METHOD_PREFIX + amortisation_method) if parameter_object is not None: for parameter in parameter_list: parameter_dict[parameter] = getattr(parameter_object, parameter, None)