Commit 34d04e97 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

variation category list cannot be handled by MovementGroup. If a user choose...

variation category list cannot be handled by MovementGroup. If a user choose to keep a divergence, variation category list of both simulation movements and lines are required. Otherwise a divergent line's variaition category will not be displayed in the matrix box.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25164 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ecd91abc
...@@ -111,7 +111,7 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -111,7 +111,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
# Call a script before building # Call a script before building
self.callBeforeBuildingScript() self.callBeforeBuildingScript()
# Select # Select
if movement_relative_url_list == []: if len(movement_relative_url_list) == 0:
movement_list = self.searchMovementList( movement_list = self.searchMovementList(
applied_rule_uid=applied_rule_uid,**kw) applied_rule_uid=applied_rule_uid,**kw)
else: else:
...@@ -485,24 +485,20 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -485,24 +485,20 @@ class OrderBuilder(XMLObject, Amount, Predicate):
delivery_line.edit(**property_dict) delivery_line.edit(**property_dict)
# Update variation category list on line # Update variation category list on line
# XXX updating variation category list should be also handled by variation_category_dict = dict([(variation_category, True) for
# MovementGroup variation_category in
line_variation_category_list = delivery_line.getVariationCategoryList() delivery_line.getVariationCategoryList()])
for movement in movement_group.getMovementList(): for movement in movement_group.getMovementList():
line_variation_category_list.extend( for category in movement.getVariationCategoryList():
movement.getVariationCategoryList()) variation_category_dict[category] = True
# erase double variation_category_list = sorted(variation_category_dict.keys())
line_variation_category_list = dict([(variation_category, 1) \ delivery_line.setVariationCategoryList(variation_category_list)
for variation_category in \
line_variation_category_list]).keys()
line_variation_category_list.sort()
delivery_line.edit(variation_category_list=line_variation_category_list)
# Then, create delivery movement (delivery cell or complete delivery # Then, create delivery movement (delivery cell or complete delivery
# line) # line)
group_list = movement_group.getGroupList() group_list = movement_group.getGroupList()
# If no group is defined for cell, we need to continue, in order to # If no group is defined for cell, we need to continue, in order to
# save the quantity value # save the quantity value
if list(group_list) != []: if len(group_list):
for group in group_list: for group in group_list:
self._deliveryCellGroupProcessing( self._deliveryCellGroupProcessing(
delivery_line, delivery_line,
...@@ -568,7 +564,7 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -568,7 +564,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
# because matrix range can be empty even if line variation category # because matrix range can be empty even if line variation category
# list is not empty # list is not empty
property_dict = {} property_dict = {}
if list(delivery_line.getCellKeyList(base_id=base_id)) == []: if len(delivery_line.getCellKeyList(base_id=base_id)) == 0:
# update line # update line
if update_existing_line == 1: if update_existing_line == 1:
if self._isUpdated(delivery_line, 'cell'): if self._isUpdated(delivery_line, 'cell'):
......
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