From 532177a5b13ecc6ac9b4edf01354d9d90623780f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Mon, 14 Apr 2008 14:48:55 +0000
Subject: [PATCH] instead of hardconding Tax Line, use order movement type list
 (which should not contain tax lines)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20496 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/OrderRule.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/product/ERP5/Document/OrderRule.py b/product/ERP5/Document/OrderRule.py
index da8ae1e7ca..c6c51e4a41 100644
--- a/product/ERP5/Document/OrderRule.py
+++ b/product/ERP5/Document/OrderRule.py
@@ -79,7 +79,8 @@ class OrderRule(DeliveryRule):
     immutable_movement_list = []
     order = applied_rule.getDefaultCausalityValue()
     if order is not None:
-      order_movement_list = order.getMovementList()
+      order_movement_list = order.getMovementList(
+                     portal_type=order.getPortalOrderMovementTypeList()):
       # check existing movements
       for movement in applied_rule.contentValues(portal_type=movement_type):
         if (not movement.getLastExpandSimulationState() in
@@ -106,9 +107,6 @@ class OrderRule(DeliveryRule):
           order_movement_dict[order_movement.getPath()] = s_m
       # Create or modify movements
       for movement in order_movement_list:
-        # FIXME: to be improved later
-        if  movement.getPortalType() not in ('Tax Line', ):
-          continue
         related_order = order_movement_dict.get(movement.getPath(), None)
         if related_order is None:
           related_order = movement.getOrderRelatedValue()
-- 
2.30.9