Commit 060902c1 authored by Tatuya Kamada's avatar Tatuya Kamada

- Add a comment why we set resource first in the _edit method.

- Fix a issue that movement_resource_interaction_workflow over-write the use, quantity_unit, base_contribution when the delivery is created by a builder.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38736 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 300e46fe
......@@ -75,6 +75,7 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
# 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):
......@@ -85,8 +86,17 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
# If variations and resources are set at the same time, resource must be
# set before any variation.
# Also, resource must be set before the categories: use, quantity_unit, base_contribution.
# Because we use the resource to set the *default* category values in
# movement_resource_interaction_worfklow, and we want to set the *proper*
# category values when they are existed in the **kw parameter.
# Thereby we set the resource first, then, set the rest.
if kw.has_key('resource_value'):
self._setResourceValue( kw['resource_value'] )
# We also take care the resource, as well as resource_value. For example in builders,
# we usually set resource instead of resource_value.
if kw.has_key('resource'):
self._setResource( kw['resource'] )
# We must first prepare the variation_base_category_list before we do the edit of the rest
#LOG('in edit', 0, str(kw))
if kw.has_key('variation_base_category_list'):
......
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