summaryrefslogtreecommitdiff
path: root/addons/web/controllers
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-10-13 17:12:34 +0200
committerDenis Ledoux <dle@odoo.com>2015-10-13 17:12:34 +0200
commit8209368b020a620e4f7287091cbe46cb70b6701e (patch)
treeafa6e86f3f181ae4258fcaa17131d50018b8489a /addons/web/controllers
parent38c9deeab4f3a4f9f48f87a4f9634c63a0fa6e13 (diff)
[FIX] web: current transaction is aborted
This reverts commit bd9cbdfc41584c829be48f6a30abb7be3a8a63fb. The above revision solved the SQL constraints not being translated when raised. They were not translated because the context, containing the lang, was not located as expected in the `kwargs` dict. While it solved this issue, it had as side-effect to raise `current transaction is aborted, commands ignored until end of transaction block` errors more often when using the web client. This can be explained by the double check, when the first check raised this error - which can happen, e.g. when the cursor is closed, there is a retry mechanism in such cases - and by the fact the transaction was not rollbacked. This issue could have been solved as well by rollbacking the transaction, but it is regarded as not-so-clean. Therefore, to solve this issue, while still having the SQL constraints translated, we apply the second patch proposed in bd9cbdfc41584c829be48f6a30abb7be3a8a63fb commit message, which is not-so-clean as well, but which is a proper solution. opw-651393
Diffstat (limited to 'addons/web/controllers')
-rw-r--r--addons/web/controllers/main.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index c598e224bba..9d3993a24c9 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -33,7 +33,6 @@ import openerp
import openerp.modules.registry
from openerp.addons.base.ir.ir_qweb import AssetsBundle, QWebTemplateNotFound
from openerp.modules import get_module_resource
-from openerp.service import model as service_model
from openerp.tools import topological_sort
from openerp.tools.translate import _
from openerp.tools import ustr
@@ -934,10 +933,7 @@ class DataSet(http.Controller):
if method.startswith('_'):
raise Exception("Access Denied: Underscore prefixed methods cannot be remotely called")
- @service_model.check
- def checked_call(__dbname, *args, **kwargs):
- return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
- return checked_call(request.db, *args, **kwargs)
+ return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
@http.route('/web/dataset/call', type='json', auth="user")
def call(self, model, method, args, domain_id=None, context_id=None):