Commit b2d4a3ec authored by Nicolas Dumazet's avatar Nicolas Dumazet

use the generic XMLMatrix._updateCellRange instead of custom code


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33613 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent add5980c
......@@ -87,20 +87,6 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
self.setQVariationBaseCategoryList(self.getQVariationBaseCategoryList())
self.setVVariationBaseCategoryList(self.getVVariationBaseCategoryList())
security.declareProtected(Permissions.ModifyPortalContent,
'_updateQMatrixCellRange')
def _updateQMatrixCellRange(self):
# XXX use base_id parameter instead
cell_range = self.TransformedResource_asCellRange('quantity')
# XXX TransformedResource works only for a maximum of 3 variation
# base category...
# Matrixbox must be rewrite for a clean implementation of n base
# category
if len(cell_range) <= 3:
self.setCellRange(base_id='quantity', *cell_range)
else:
raise MoreThan3VariationBaseCategory
security.declareProtected(Permissions.ModifyPortalContent,
'_setQVariationBaseCategoryList')
def _setQVariationBaseCategoryList(self, value):
......@@ -109,8 +95,7 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
variate on
"""
self._baseSetQVariationBaseCategoryList(value)
# XXX calling updatecellRange is better
self._updateQMatrixCellRange()
self._updateCellRange('quantity')
security.declareProtected(Permissions.ModifyPortalContent,
'setQVariationBaseCategoryList')
......@@ -122,20 +107,6 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
self._setQVariationBaseCategoryList(value)
self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent,
'_updateVMatrixCellRange')
def _updateVMatrixCellRange(self):
# XXX use base_id parameter instead
cell_range = self.TransformedResource_asCellRange('variation')
# XXX TransformedResource works only for a maximum of 3 variation
# base category...
# Matrixbox must be rewrite for a clean implementation of n base
# category
if len(cell_range) <= 3:
self.setCellRange(base_id='variation', *cell_range)
else:
raise MoreThan3VariationBaseCategory
security.declareProtected(Permissions.ModifyPortalContent,
'_setVVariationBaseCategoryList')
def _setVVariationBaseCategoryList(self, value):
......@@ -144,8 +115,7 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
variate on
"""
self._baseSetVVariationBaseCategoryList(value)
# XXX calling updatecellRange is better
self._updateVMatrixCellRange()
self._updateCellRange('variation')
security.declareProtected(Permissions.ModifyPortalContent,
'setVVariationBaseCategoryList')
......
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