Commit a5fface2 authored by Julien Muchembled's avatar Julien Muchembled

Fix ERP5Legacy.OrderBuilder._findUpdatableObject

- fix getting delivery value from a simulation movement
- revert 38277 partially, since it only worked when working at delivery level

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42339 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d0441ea1
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Base import Base
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Core.Predicate import Predicate from Products.ERP5Type.Core.Predicate import Predicate
from Products.ERP5.Document.Amount import Amount from Products.ERP5.Document.Amount import Amount
...@@ -330,18 +331,19 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -330,18 +331,19 @@ class OrderBuilder(XMLObject, Amount, Predicate):
# XXX in the case of Order Builder, the movement is not always # XXX in the case of Order Builder, the movement is not always
# related to simulation, thus it might not have the delivery category. # related to simulation, thus it might not have the delivery category.
# Possibly, this code should be overridden by DeliveryBuilder. # Possibly, this code should be overridden by DeliveryBuilder.
if getattr(aq_base(movement), 'getDeliveryValue', None) is not None: try:
delivery_movement = movement.getDeliveryValue() delivery = movement.getDeliveryValue()
except AttributeError:
pass
else: else:
delivery_movement = None while isinstance(delivery, Base):
if delivery_movement is not None: try:
delivery = delivery_movement.getRootDeliveryValue() instance_list.remove(delivery)
try: except ValueError:
instance_list.remove(delivery) pass
except ValueError: else:
pass instance_list.insert(0, delivery)
else: delivery = delivery.getParentValue()
instance_list.insert(0, delivery)
for instance_to_update in instance_list: for instance_to_update in instance_list:
result, property_dict = self._test( result, property_dict = self._test(
instance_to_update, movement_group_node_list, divergence_list) instance_to_update, movement_group_node_list, divergence_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