Commit 6091d0c3 authored by Julien Muchembled's avatar Julien Muchembled

Use Base._edit to update special properties of DeliveryCell and MappedValue

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34287 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9930e40b
...@@ -143,22 +143,20 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement): ...@@ -143,22 +143,20 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
# This little hack is needed to make the matrixbox working # This little hack is needed to make the matrixbox working
# in DeliveryLine_viewIndustrialPhase # in DeliveryLine_viewIndustrialPhase
# Generic form (DeliveryLine_viewOption) is required # Generic form (DeliveryLine_viewOption) is required
security.declarePrivate('_edit') def _edit(self, **kw):
def _edit(self, REQUEST=None, force_update=0, reindex_object=0, **kw):
""" """
Store variation_category_list, in order to store new value of Store variation_category_list, in order to store new value of
industrial_phase after. industrial_phase after.
""" """
if kw.has_key('variation_category_list'): edit_order = ['variation_category_list', # edit this one first
self._setVariationCategoryList(kw['variation_category_list']) 'item_id_list'] # this one must be the last
kw.pop('variation_category_list') edit_order[1:1] = [x for x in kw.pop('edit_order', ())
MappedValue._edit(self, REQUEST=REQUEST, force_update=force_update, if x not in edit_order]
reindex_object=reindex_object, **kw) # Base._edit updates unordered properties first
edit_order[1:1] = [x for x in kw if x not in edit_order]
MappedValue._edit(self, edit_order=edit_order, **kw)
# if self.isSimulated(): # if self.isSimulated():
# self.getRootDeliveryValue().activate().propagateResourceToSimulation() # self.getRootDeliveryValue().activate().propagateResourceToSimulation()
# This one must be the last
if kw.has_key('item_id_list'):
self._setItemIdList(kw['item_id_list'])
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'updateSimulationDeliveryProperties') 'updateSimulationDeliveryProperties')
......
...@@ -67,16 +67,14 @@ class MappedValue(Predicate, Amount): ...@@ -67,16 +67,14 @@ class MappedValue(Predicate, Amount):
, PropertySheet.MappedValue , PropertySheet.MappedValue
) )
security.declarePrivate( '_edit' ) def _edit(self, **kw):
def _edit(self, REQUEST=None, force_update = 0, **kw):
# We must first prepare the mapped value before we do the edit # We must first prepare the mapped value before we do the edit
if kw.has_key('mapped_value_property_list'): edit_order = ['mapped_value_property_list',
self._setProperty('mapped_value_property_list', kw['mapped_value_property_list']) 'default_mapped_value_property',
if kw.has_key('default_mapped_value_property'): 'mapped_value_property',
self._setProperty('default_mapped_value_property', kw['default_mapped_value_property']) 'mapped_value_property_set']
if kw.has_key('mapped_value_property'): i = len(edit_order)
self._setProperty('mapped_value_property', kw['mapped_value_property']) edit_order += [x for x in kw.pop('edit_order', ()) if x not in edit_order]
if kw.has_key('mapped_value_property_set'): # Base._edit updates unordered properties first
self._setProperty('mapped_value_property_set', kw['mapped_value_property_set']) edit_order[i:i] = [x for x in kw if x not in edit_order]
Predicate._edit(self, REQUEST=REQUEST, force_update = force_update, **kw) return Predicate._edit(self, edit_order=edit_order, **kw)
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