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):
# This little hack is needed to make the matrixbox working
# in DeliveryLine_viewIndustrialPhase
# Generic form (DeliveryLine_viewOption) is required
security.declarePrivate('_edit')
def _edit(self, REQUEST=None, force_update=0, reindex_object=0, **kw):
def _edit(self, **kw):
"""
Store variation_category_list, in order to store new value of
industrial_phase after.
"""
if kw.has_key('variation_category_list'):
self._setVariationCategoryList(kw['variation_category_list'])
kw.pop('variation_category_list')
MappedValue._edit(self, REQUEST=REQUEST, force_update=force_update,
reindex_object=reindex_object, **kw)
edit_order = ['variation_category_list', # edit this one first
'item_id_list'] # this one must be the last
edit_order[1:1] = [x for x in kw.pop('edit_order', ())
if x not in edit_order]
# 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():
# 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,
'updateSimulationDeliveryProperties')
......
......@@ -67,16 +67,14 @@ class MappedValue(Predicate, Amount):
, PropertySheet.MappedValue
)
security.declarePrivate( '_edit' )
def _edit(self, REQUEST=None, force_update = 0, **kw):
def _edit(self, **kw):
# We must first prepare the mapped value before we do the edit
if kw.has_key('mapped_value_property_list'):
self._setProperty('mapped_value_property_list', kw['mapped_value_property_list'])
if kw.has_key('default_mapped_value_property'):
self._setProperty('default_mapped_value_property', kw['default_mapped_value_property'])
if kw.has_key('mapped_value_property'):
self._setProperty('mapped_value_property', kw['mapped_value_property'])
if kw.has_key('mapped_value_property_set'):
self._setProperty('mapped_value_property_set', kw['mapped_value_property_set'])
Predicate._edit(self, REQUEST=REQUEST, force_update = force_update, **kw)
edit_order = ['mapped_value_property_list',
'default_mapped_value_property',
'mapped_value_property',
'mapped_value_property_set']
i = len(edit_order)
edit_order += [x for x in kw.pop('edit_order', ()) if x not in edit_order]
# Base._edit updates unordered properties first
edit_order[i:i] = [x for x in kw if x not in edit_order]
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