Commit 0b0321d8 authored by Nicolas Delaby's avatar Nicolas Delaby

Change activity method for expandAmortisation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12856 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4ca1fdb5
...@@ -997,7 +997,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -997,7 +997,7 @@ class ImmobilisableItem(XMLObject, Amount):
security.declareProtected(Permissions.View, 'expandAmortisation') security.declareProtected(Permissions.View, 'expandAmortisation')
def expandAmortisation(self): def expandAmortisation(self,**kw):
""" """
Calculate the amortisation annuities for the item Calculate the amortisation annuities for the item
in an activity in an activity
...@@ -1007,12 +1007,11 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -1007,12 +1007,11 @@ class ImmobilisableItem(XMLObject, Amount):
# are no more in 'calculating' immobilisation_state # are no more in 'calculating' immobilisation_state
related_packing_list_list = self.getAggregateRelatedValueList() related_packing_list_list = self.getAggregateRelatedValueList()
related_packing_list_path_list = [x.getPath() for x in related_packing_list_list] related_packing_list_path_list = [x.getPath() for x in related_packing_list_list]
related_packing_list_uid_list = ['%i' % x.getUid() for x in related_packing_list_list]
self.activate( self.activate(
after_path_and_method_id=( after_path_and_method_id=(
related_packing_list_path_list, related_packing_list_path_list,
['immediateReindexObject', 'recursiveImmediateReindexObject', 'updateImmobilisationState']), ['immediateReindexObject', 'recursiveImmediateReindexObject', 'updateImmobilisationState']),
after_tag=related_packing_list_uid_list after_tag='expand_amortisation'
).immediateExpandAmortisation() ).immediateExpandAmortisation()
...@@ -1022,12 +1021,12 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -1022,12 +1021,12 @@ class ImmobilisableItem(XMLObject, Amount):
Calculate the amortisation annuities for the item Calculate the amortisation annuities for the item
SHOULD BE RUN AS MANAGER SHOULD BE RUN AS MANAGER
""" """
activate_kw = {'tag':'expand_amortisation'}
try: try:
self._createAmortisationRule() self._createAmortisationRule()
except ImmobilisationValidityError: except ImmobilisationValidityError:
related_packing_list_list = self.getAggregateRelatedValueList() related_packing_list_list = self.getAggregateRelatedValueList()
related_packing_list_uid_list = ['%i' % x.getUid() for x in related_packing_list_list] self.activate().expandAmortisation(activate_kw=activate_kw)
self.activate(tag=related_packing_list_uid_list).expandAmortisation()
security.declareProtected(Permissions.View, 'getSectionMovementValueList') security.declareProtected(Permissions.View, 'getSectionMovementValueList')
......
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