From 628872c8f884f51bce7def290aba58e0254dd3a8 Mon Sep 17 00:00:00 2001
From: Tatuya Kamada <tatuya@nexedi.com>
Date: Wed, 22 Sep 2010 08:00:43 +0000
Subject: [PATCH] Make it possible to decide updating existing document or not
 with the update_always flag.

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

diff --git a/product/ERP5/Document/PropertyGroupingMovementGroup.py b/product/ERP5/Document/PropertyGroupingMovementGroup.py
index 64d492c7b6..51c961e003 100644
--- a/product/ERP5/Document/PropertyGroupingMovementGroup.py
+++ b/product/ERP5/Document/PropertyGroupingMovementGroup.py
@@ -36,10 +36,12 @@ class PropertyGroupingMovementGroup(MovementGroup):
   portal_type = 'Property Grouping Movement Group'
 
   def test(self, document, property_dict, **kw):
-    # We always separate the movements from the exsiting document, because we 
-    # did not assign the properties into the document thanks to this movement group.
+    # We did not assign the properties into the document thanks to this movement group.
     # Therefore their is no way to compare the properties between the document
     # and the movements. In other words, they are always different.
+    # So, we only check the update_always flag on the movement group setting here.
+    if self.isUpdateAlways():
+      return True, {}
     return False, {}
 
   def _separate(self, movement_list):
-- 
2.30.9