Commit 722963ca authored by Jérome Perrin's avatar Jérome Perrin

code to migrate Invoice Transaction Rule matrix index to new cell range from r20475.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21581 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ad042a8f
...@@ -100,3 +100,17 @@ def updateCareerValidationState(self): ...@@ -100,3 +100,17 @@ def updateCareerValidationState(self):
career.workflow_history._p_changed = 1 career.workflow_history._p_changed = 1
career.reindexObject() career.reindexObject()
def updateInvoiceTransactionRule(self):
"""Invoice Transaction Rule now uses ID instead of relative urls for cell
coordinates (r20475)
"""
assert self.getPortalType() == 'Invoice Transaction Rule'
movement_index = aq_base(self).index['movement']
for index, coordinate_dict in movement_index.items():
fixed_coordinate_list = []
for coord, index in coordinate_dict.items():
new_coord = coord.split('/')[-1]
coordinate_dict[new_coord] = coordinate_dict.pop(coord)
# ( coordinate_dict is a persistent mapping, so no need to mark the
# object as _p_changed )
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