From a2911db78c8b7552e909722d2f2303ed639530e4 Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Sun, 8 Feb 2004 19:11:48 +0000
Subject: [PATCH] solved conflict

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@436 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index f383ae9380..6428ffd7fc 100755
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -435,7 +435,7 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana
 
   # Object attributes update method
   security.declarePrivate( '_edit' )
-  def _edit(self, REQUEST=None, force_update = 0, **kw):
+  def _edit(self, REQUEST=None, force_update = 0, reindex_object = 0, **kw):
     """
       Generic edit Method for all ERP5 object
       The purpose of this method is to update attributed, eventually do
@@ -475,9 +475,9 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana
         self.aq_parent.manage_renameObjects([self.id], [kw['id']])
         new_relative_url = self.getRelativeUrl()
         id_changed = 1
-    self.reindexObject()
+    if reindex_object: self.reindexObject()
     if id_changed:
-      self.recursiveFlushActivity(invoke=1)  # Required if we wish that news ids appear instantly
+      if reindex_object: self.flushActivity(invoke=1) # Required if we wish that news ids appear instantly
       #if self.isIndexable:
       #  self.moveObject()             # Required if we wish that news ids appear instantly
       #if hasattr(aq_base(self), 'recursiveMoveObject'):
@@ -493,8 +493,8 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana
     self._getCategoryTool().updateRelatedContent(self, previous_category_url, new_category_url)
 
   security.declareProtected( Permissions.ModifyPortalContent, 'edit' )
-  def edit(self, REQUEST=None, force_update = 0, **kw):
-    return self._edit(REQUEST=REQUEST, force_update=force_update, **kw)
+  def edit(self, REQUEST=None, force_update = 0, reindex_object=1, **kw):
+    return self._edit(REQUEST=REQUEST, force_update=force_update, reindex_object=reindex_object, **kw)
   edit = WorkflowMethod( edit )
 
   # Accessing object property Ids
@@ -923,6 +923,13 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana
     """
     return self._getCategoryTool().isMemberOf(self, category)
 
+  security.declareProtected( Permissions.View, 'isAcquiredMemberOf' )
+  def isAcquiredMemberOf(self, category):
+    """
+      Tests if an object if member of a given category
+    """
+    return self._getCategoryTool().isAcquiredMemberOf(self, category)
+
   # Aliases
   security.declareProtected(Permissions.View, 'getTitleOrId')
   def getTitleOrId(self):
@@ -1202,6 +1209,16 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana
 
     pass
 
+  security.declareProtected(Permissions.ModifyPortalContent, 'commitTransaction')
+  def commitTransaction(self):
+    # Commit a zope transaction (to reduce locks)
+    get_transaction().commit()
+
+  security.declareProtected(Permissions.ModifyPortalContent, 'abortTransaction')
+  def abortTransaction(self):
+    # Abort a zope transaction (to reduce locks)
+    get_transaction().abort()
+
   # Hash method
   def __hash__(self):
     return self.getUid()
-- 
2.30.9