Commit 6f57bafe authored by Jean-Paul Smets's avatar Jean-Paul Smets

added support for category id update


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@992 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 050cf337
......@@ -372,3 +372,15 @@ Une ligne tarifaire."""
if len(result) > 0:
return result[0].target_quantity
return None
security.declareProtected( Permissions.ModifyPortalContent, 'notifyAfterUpdateRelatedContent' )
def notifyAfterUpdateRelatedContent(self, previous_category_url, new_category_url):
"""
Membership Crirerions and Category List are same in DeliveryCell
Must update it (or change implementation to remove data duplication)
"""
update_method = self.portal_categories.updateRelatedCategory
predicate_value = self.getPredicateValueList()
new_predicate_value = map(lambda c: update_method(c, previous_category_url, new_category_url), predicate_value)
self._setPredicateValueList(new_predicate_value) # No reindex needed since uid stable
\ No newline at end of file
......@@ -130,6 +130,9 @@ Une ligne tarifaire."""
)
}
# Multiple inheritance definition
updateRelatedContent = XMLMatrix.updateRelatedContent
# Force in _edit to modify variation_base_category_list first
security.declarePrivate( '_edit' )
def _edit(self, REQUEST=None, force_update = 0, **kw):
......@@ -143,7 +146,7 @@ Une ligne tarifaire."""
# This one must be the last
if kw.has_key('item_id_list'):
self._setItemIdList( kw['item_id_list'] )
security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable')
def isAccountable(self):
"""
......@@ -446,7 +449,7 @@ Une ligne tarifaire."""
security.declarePrivate('_checkConsistency')
def _checkConsistency(self, fixit=0):
def _checkConsistency(self, fixit=0, mapped_value_property_list = ('target_quantity', 'quantity', 'price')):
"""
Check the constitency of transformation elements
"""
......@@ -457,7 +460,7 @@ Une ligne tarifaire."""
q_constraint = Constraint.AttributeEquality(
domain_base_category_list = self.getVariationBaseCategoryList(),
predicate_operator = 'SUPERSET_OF',
mapped_value_property_list = ('target_quantity', 'quantity', 'price') )
mapped_value_property_list = mapped_value_property_list )
for k in self.getCellKeys(base_id = 'movement'):
kw={}
kw['base_id'] = 'movement'
......
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