[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:
parent
8ab987d828
commit
fdc6ba1820
|
@ -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":
|
||||
|
|
Loading…
Reference in New Issue