From a5ee246e9f4e566a70097943d61b0b0140e36044 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Mon, 26 Apr 2010 10:00:13 +0000
Subject: [PATCH] do not raise an exception if start_date and/or stop_date is
 omitted.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34772 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/TargetSolver/SplitAndDefer.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/product/ERP5/TargetSolver/SplitAndDefer.py b/product/ERP5/TargetSolver/SplitAndDefer.py
index 7bea156eb7..572bfb4b17 100644
--- a/product/ERP5/TargetSolver/SplitAndDefer.py
+++ b/product/ERP5/TargetSolver/SplitAndDefer.py
@@ -104,10 +104,14 @@ class SplitAndDefer(CopyToTarget):
           movement_dict.update(**{
             prop: simulation_movement.getProperty(prop)})
       new_movement = applied_rule.newContent(**movement_dict)
-      new_movement.recordProperty('start_date')
-      new_movement.recordProperty('stop_date')
-      new_movement.edit(start_date=self.start_date,
-                        stop_date=self.stop_date)
+      start_date = getattr(self, 'start_date', None)
+      if start_date is not None:
+        new_movement.recordProperty('start_date')
+        new_movement.edit(start_date=start_date)
+      stop_date = getattr(self, 'stop_date', None)
+      if stop_date is not None:
+        new_movement.recordProperty('stop_date')
+        new_movement.edit(stop_date=stop_date)
       new_movement.activate(**self.additional_parameters).expand()
     # adopt new quantity on original simulation movement
     simulation_movement.edit(quantity=new_movement_quantity)
-- 
2.30.9