Commit c25640c7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

backport SimulationMovement.asComposedDocument() and modify...

backport SimulationMovement.asComposedDocument() and modify TradeCondition.getTradeModelLineComposedList() so as to search trade model lines from the nearest delivery in the simulation tree.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34856 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0efe7dbf
......@@ -306,6 +306,22 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
if explanation_value != portal:
return explanation_value
def asComposedDocument(self, *args, **kw):
# XXX: What delivery should be used to find amount generator lines ?
# With the currently enabled code, entire branches in the simulation
# tree get (temporary) deleted when new delivery lines are being built
# (and don't have yet a specialise value).
# With the commented code, changing the STC on a SIT generated from a
# SPL/SO would have no impact (and would never make the SIT divergent).
#return self.getRootSimulationMovement() \
# .getDeliveryValue() \
# .asComposedDocument(*args, **kw)
while 1:
delivery_value = self.getDeliveryValue()
if delivery_value is not None:
return delivery_value.asComposedDocument(*args, **kw)
self = self.getParentValue().getParentValue()
# Deliverability / orderability
security.declareProtected( Permissions.AccessContentsInformation,
'isOrderable')
......
......@@ -149,10 +149,6 @@ class TradeCondition(Path, Transformation):
"""
if portal_type_list is None:
portal_type_list = self.model_line_portal_type_list
try:
context = context.getExplanationValue()
except AttributeError:
pass
trade_model_line_composed_list = \
context.asComposedDocument().contentValues(portal_type=portal_type_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