From 4496b89817c358d603b10f02a727b940e1dece27 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 14 Sep 2018 15:04:16 +0900
Subject: [PATCH] ERP5Type: Do not prepare for immediate indexation when it's
 not requested.

Also, tix typo in comment.
---
 product/ERP5Type/ERP5Type.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/ERP5Type.py b/product/ERP5Type/ERP5Type.py
index c160a80494..c6330990b1 100644
--- a/product/ERP5Type/ERP5Type.py
+++ b/product/ERP5Type/ERP5Type.py
@@ -443,8 +443,8 @@ class ERP5TypeInformation(XMLObject,
       if kw:
         ob._edit(force_update=1, **kw)
 
-      if not temp_object:
-        # As we juste created ob, we assume the whole subtree is of a
+      if not temp_object and immediate_reindex is not None:
+        # As we just created ob, we assume the whole subtree is of a
         # reasonable size and hence can be walked in current transaction.
         # Subtree may come from:
         # - acquired setter (ex: address on a Person which actually exists on
-- 
2.30.9