Commit b90c8920 authored by Nicolas Delaby's avatar Nicolas Delaby

Call expandAmortisation in order for ImmobilisableItem

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12528 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 670e18e2
...@@ -1007,10 +1007,12 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -1007,10 +1007,12 @@ 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 = ['%s' % 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
).immediateExpandAmortisation() ).immediateExpandAmortisation()
...@@ -1023,7 +1025,9 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -1023,7 +1025,9 @@ class ImmobilisableItem(XMLObject, Amount):
try: try:
self._createAmortisationRule() self._createAmortisationRule()
except ImmobilisationValidityError: except ImmobilisationValidityError:
self.expandAmortisation() related_packing_list_list = self.getAggregateRelatedValueList()
related_packing_list_uid_list = ['%s' % x.getUid() for x in related_packing_list_list]
self.activate(tag=related_packing_list_uid_list).expandAmortisation()
security.declareProtected(Permissions.View, 'getSectionMovementValueList') security.declareProtected(Permissions.View, 'getSectionMovementValueList')
...@@ -1121,4 +1125,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -1121,4 +1125,7 @@ class ImmobilisableItem(XMLObject, Amount):
for k,v in kw.items(): for k,v in kw.items():
if k not in no_sql_list: if k not in no_sql_list:
sql_dict[k] = v sql_dict[k] = v
return sql_dict return sql_dict
\ No newline at end of file
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