From 485e4374409794be1d2baef4d813f8d351578859 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 29 Oct 2012 19:07:42 +0100 Subject: [PATCH] [FIX] orm: _validate should not immediately rollback For some obscure reason _validate used to immediately rollback the current transaction as soon as a constraint failed anywhere. This is completely incorrect and violates the transaction abstraction: the responsibility of creating and closing transactions belongs to the RPC dispatch layer, or whatever takes its place (e.g. the test setup/teardown for tests). Rolling back or committing in the middle of a transaction precludes special error treatment and can have very bad side effects. bzr revid: odo@openerp.com-20121029180742-2gw08kobdh7w5njc --- openerp/osv/orm.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 4c3330c97b7..10ec38e4877 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -1548,7 +1548,6 @@ class BaseModel(object): ) self._invalids.update(fields) if error_msgs: - cr.rollback() raise except_orm('ValidateError', '\n'.join(error_msgs)) else: self._invalids.clear()