Commit ece9eb52 authored by Sebastien Robin's avatar Sebastien Robin

we should be able to specify a script to udpateCellRange


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2858 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cf86071c
......@@ -313,7 +313,7 @@ class XMLMatrix(Folder):
self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'updateCellRange')
def updateCellRange(self, base_id):
def updateCellRange(self, base_id,script_id=None):
"""
The asCellRange script if PT dependent
whoch is not the case with this kind of code
......@@ -327,11 +327,14 @@ class XMLMatrix(Folder):
asCellRange scripts should be unified if possible
"""
script_name_end = '_asCellRange'
for script_name_begin in [self.getPortalType(), self.getMetaType(), self.__class__.__name__]:
script_name = join( [ replace(script_name_begin, ' ','') , script_name_end ], '')
if hasattr(self, script_name):
script = getattr(self, script_name)
break
if script_id is not None:
script = getattr(self, script_id)
else:
for script_name_begin in [self.getPortalType(), self.getMetaType(), self.__class__.__name__]:
script_name = join( [ replace(script_name_begin, ' ','') , script_name_end ], '')
if hasattr(self, script_name):
script = getattr(self, script_name)
break
cell_range = script(matrixbox=0)
self.setCellRange(base_id=base_id, *cell_range)
......
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