From fdc6ba18206d7ee00118e58e9eb1d75350e1b498 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Mon, 11 May 2015 10:58:23 +0200 Subject: [PATCH] [FIX] http: make sure to instantiate an environment before calling method This fixes an issue in property `field.digits` that cannot find a valid cursor to the database. Forcing the instantiation of an environment makes the cursor retrievable. --- openerp/http.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/http.py b/openerp/http.py index d56e2d84649..b972c610329 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -896,7 +896,8 @@ class Model(object): raise Exception("Access denied") mod = request.registry[self.model] meth = getattr(mod, method) - cr = request.cr + # make sure to instantiate an environment + cr = request.env.cr result = meth(cr, request.uid, *args, **kw) # reorder read if method == "read":