[Erp5-report] r34856 kazuhiko - /erp5/trunk/products/ERP5/Document/
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Apr 29 15:16:29 CEST 2010
Author: kazuhiko
Date: Thu Apr 29 15:16:24 2010
New Revision: 34856
URL: http://svn.erp5.org?rev=34856&view=rev
Log:
backport SimulationMovement.asComposedDocument() and modify TradeCondition.getTradeModelLineComposedList() so as to search trade model lines from the nearest delivery in the simulation tree.
Modified:
erp5/trunk/products/ERP5/Document/SimulationMovement.py
erp5/trunk/products/ERP5/Document/TradeCondition.py
Modified: erp5/trunk/products/ERP5/Document/SimulationMovement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/SimulationMovement.py?rev=34856&r1=34855&r2=34856&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] Thu Apr 29 15:16:24 2010
@@ -306,6 +306,22 @@
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')
Modified: erp5/trunk/products/ERP5/Document/TradeCondition.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TradeCondition.py?rev=34856&r1=34855&r2=34856&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TradeCondition.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TradeCondition.py [utf8] Thu Apr 29 15:16:24 2010
@@ -149,10 +149,6 @@
"""
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)
More information about the Erp5-report
mailing list