[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.
This commit is contained in:
Raphael Collet 2015-05-11 10:58:23 +02:00
parent 8ab987d828
commit fdc6ba1820
1 changed files with 2 additions and 1 deletions

View File

@ -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":