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,17 +144,21 @@ class OrderRule(Rule): ...@@ -144,17 +144,21 @@ 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))
if order_line_object.getVariationCategoryList() == []:
new_line = applied_rule.newContent( new_line = applied_rule.newContent(
type_name=delivery_line_type, type_name=delivery_line_type,
container=applied_rule, container=applied_rule,
id=new_id, id=new_id,
order_value = order_line_object, order_value = order_line_object,
quantity = order_line_object.getQuantity(), quantity = order_line_object.getQuantity(),
# source = order_line_object.getSource(), # No acquisition on variation_category_list in this case,
# destination = order_line_object.getDestination(), # to prevent user failure
# source_section = order_line_object.getSourceSection(), variation_category_list = [],
# destination_section = \ # source = order_line_object.getSource(),
# order_line_object.getDestinationSection(), # destination = order_line_object.getDestination(),
# source_section = order_line_object.getSourceSection(),
# destination_section = \
# order_line_object.getDestinationSection(),
deliverable = 1 deliverable = 1
) )
LOG('OrderRule.expand, object created:',0, \ LOG('OrderRule.expand, object created:',0, \
...@@ -163,6 +167,10 @@ class OrderRule(Rule): ...@@ -163,6 +167,10 @@ class OrderRule(Rule):
LOG('After Create Cell', 0, str(new_id)) LOG('After Create Cell', 0, str(new_id))
# Source, Destination, Quantity, Date, etc. are # Source, Destination, Quantity, Date, etc. are
# acquired from the order and need not to be copied. # 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