[FIX] document: removed dangerous and useless commits
authorOlivier Dony <odo@openerp.com>
Wed, 30 Nov 2011 12:02:39 +0000 (13:02 +0100)
committerOlivier Dony <odo@openerp.com>
Wed, 30 Nov 2011 12:02:39 +0000 (13:02 +0100)
These commits were introduce mostly at revision
1849.1.1 revid:hmo@tinyerp.com-20081111052750-zqzvr6oaihvt103t
in an attempt to fix an issue with transactions
originating from FTP connections.
This was wrong: the virtual FTP filesystem should
perform its own transaction management for each
operation, just like the RPC layer does it for
each request. Forcing a commit in the business
code during the course of a normal transaction is
totally *forbidden*!
In addition, the FTP layer now properly manages
its transactions, so the commit calls were useless
anyway.

bzr revid: odo@openerp.com-20111130120239-5fcavvpd14w056zb

addons/document/document.py
addons/document/test/document_test2.yml

index 1bf177f..36b10b3 100644 (file)
@@ -254,7 +254,6 @@ class document_file(osv.osv):
             del vals['file_size']
         if ids and vals:
             result = super(document_file,self).write(cr, uid, ids, vals, context=context)
-        cr.commit() # ?
         return result
 
     def create(self, cr, uid, vals, context=None):
@@ -299,7 +298,6 @@ class document_file(osv.osv):
         else:
             #raise osv.except_osv(_('ValidateError'), _('File name must be unique!'))
             result = super(document_file, self).create(cr, uid, vals, context)
-            cr.commit() # ?
         return result
 
     def __get_partner_id(self, cr, uid, res_model, res_id, context=None):
index 65312ea..be91bfb 100644 (file)
@@ -80,4 +80,3 @@
 -
     !python {model: document.directory}: |
       self.unlink(cr, uid, [ref('dir_tests')])
-      cr.commit()