Commit 64960de1 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Do not fail even if a movement does not have the delivery category.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38857 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8bfb0fb9
...@@ -35,7 +35,7 @@ from Products.ERP5.MovementGroup import MovementGroupNode ...@@ -35,7 +35,7 @@ from Products.ERP5.MovementGroup import MovementGroupNode
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from DateTime import DateTime from DateTime import DateTime
from Acquisition import aq_parent, aq_inner from Acquisition import aq_parent, aq_inner, aq_base
class CollectError(Exception): pass class CollectError(Exception): pass
class MatrixError(Exception): pass class MatrixError(Exception): pass
...@@ -323,7 +323,13 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -323,7 +323,13 @@ class OrderBuilder(XMLObject, Amount, Predicate):
else: else:
# we want to check the original delivery first. # we want to check the original delivery first.
movement = current_movement_group_node.getMovementList()[0] movement = current_movement_group_node.getMovementList()[0]
delivery_movement = movement.getDeliveryValue() # XXX in the case of Order Builder, the movement is not always
# related to simulation, thus it might not have the delivery category.
# Possibly, this code should be overridden by DeliveryBuilder.
if getattr(aq_base(movement), 'getDeliveryValue', None) is not None:
delivery_movement = movement.getDeliveryValue()
else:
delivery_movement = None
if delivery_movement is not None: if delivery_movement is not None:
delivery = delivery_movement.getRootDeliveryValue() delivery = delivery_movement.getRootDeliveryValue()
try: try:
......
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