hooks/security.py
changeset 10114 6f4b4567b77d
parent 9984 793377697c81
child 10156 57b68193413c
--- a/hooks/security.py	Tue Dec 09 15:18:58 2014 +0100
+++ b/hooks/security.py	Wed Dec 17 10:55:53 2014 +0100
@@ -116,8 +116,9 @@
         # save back editedattrs in case the entity is reedited later in the
         # same transaction, which will lead to cw_edited being
         # overwritten
+        action = 'add' if self._cw.added_in_transaction(self.entity.eid) else 'update'
         CheckEntityPermissionOp.get_instance(self._cw).add_data(
-            (self.entity.eid, 'update', self.entity.cw_edited) )
+            (self.entity.eid, action, self.entity.cw_edited) )
 
 
 class BeforeDelEntitySecurityHook(SecurityHook):