Commit b1be2644 authored by Romain Courteaud's avatar Romain Courteaud

Bug fix: do not expand Simulation when getVariationCategoryList on a OrderLine

is not empty, and no cell is created.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2902 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e7d06339
...@@ -144,25 +144,33 @@ class OrderRule(Rule): ...@@ -144,25 +144,33 @@ class OrderRule(Rule):
if order_line_object.getUid() not in existing_uid_list: if order_line_object.getUid() not in existing_uid_list:
new_id = order_line_object.getId() new_id = order_line_object.getId()
LOG('Line', 0, str(new_id)) LOG('Line', 0, str(new_id))
new_line = applied_rule.newContent( if order_line_object.getVariationCategoryList() == []:
type_name=delivery_line_type, new_line = applied_rule.newContent(
container=applied_rule, type_name=delivery_line_type,
id=new_id, container=applied_rule,
order_value = order_line_object, id=new_id,
quantity = order_line_object.getQuantity(), order_value = order_line_object,
# source = order_line_object.getSource(), quantity = order_line_object.getQuantity(),
# destination = order_line_object.getDestination(), # No acquisition on variation_category_list in this case,
# source_section = order_line_object.getSourceSection(), # to prevent user failure
# destination_section = \ variation_category_list = [],
# order_line_object.getDestinationSection(), # source = order_line_object.getSource(),
deliverable = 1 # destination = order_line_object.getDestination(),
) # source_section = order_line_object.getSourceSection(),
LOG('OrderRule.expand, object created:',0, \ # destination_section = \
new_line.getPhysicalPath()) # order_line_object.getDestinationSection(),
new_line.immediateReindexObject() deliverable = 1
LOG('After Create Cell', 0, str(new_id)) )
# Source, Destination, Quantity, Date, etc. are LOG('OrderRule.expand, object created:',0, \
# acquired from the order and need not to be copied. new_line.getPhysicalPath())
new_line.immediateReindexObject()
LOG('After Create Cell', 0, str(new_id))
# Source, Destination, Quantity, Date, etc. are
# acquired from the order and need not to be copied.
else:
raise 'Error', 'VariationCategoryList is defined on\
OrderLine %s and no cell exists.' %\
order_line_object.getRelativeUrl()
except AttributeError: except AttributeError:
LOG('ERP5: WARNING', 0, \ LOG('ERP5: WARNING', 0, \
'AttributeError during expand on order line %s' \ 'AttributeError during expand on order line %s' \
......
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