diff --git a/product/ERP5/Document/DeliveryCell.py b/product/ERP5/Document/DeliveryCell.py index c2e3ec1a2d6c70a7d141f41910ade55b6a30010f..c02ac2f2606061a772b9076e50399ecd5f62574e 100755 --- a/product/ERP5/Document/DeliveryCell.py +++ b/product/ERP5/Document/DeliveryCell.py @@ -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 diff --git a/product/ERP5/Document/DeliveryLine.py b/product/ERP5/Document/DeliveryLine.py index af35babe042c7afde6354c73b58be18c2b0f6c27..c7301c2442d53d60ec78cc3f5ff00d112f12eb4a 100755 --- a/product/ERP5/Document/DeliveryLine.py +++ b/product/ERP5/Document/DeliveryLine.py @@ -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'