From cfb789d23e7bd84b45370812f865d8e5d30c301f Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Mon, 26 Mar 2012 17:23:56 +0200
Subject: [PATCH] Trade: empty amounts shall not be generated when legacy
 simulation is used

This reverts commit 414042ade46f3a5b9e1dd1d60fc95761bc6eea7a partially,
which is required for testLegacySimulationPerformance
---
 product/ERP5Legacy/Document/TradeModelRule.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/product/ERP5Legacy/Document/TradeModelRule.py b/product/ERP5Legacy/Document/TradeModelRule.py
index c30fc8d3ba..48d74e0a0e 100644
--- a/product/ERP5Legacy/Document/TradeModelRule.py
+++ b/product/ERP5Legacy/Document/TradeModelRule.py
@@ -70,6 +70,8 @@ class TradeModelRule(Rule):
 
     context_movement = applied_rule.getParentValue()
     for amount in trade_condition.getAggregatedAmountList(context_movement):
+      if not amount.getQuantity():
+        continue
       # business path specific
       business_path_list = business_process.getPathValueList(
           trade_phase=amount.getTradePhaseList(), context=context_movement)
-- 
2.30.9