diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-09-04 12:57:18 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-09-04 12:58:00 +0200 |
| commit | bd9cbdfc41584c829be48f6a30abb7be3a8a63fb (patch) | |
| tree | ced9c62e4db3e659ce9e32a39aeec6a5d3cad22f /addons/analytic_user_function/analytic_user_function_view.xml | |
| parent | 64e1c28e358ec06a7683249fd7fae1ba631c1933 (diff) | |
[FIX] web: sql constraint translation
The `check` decorator expects the context to be in the `kwargs`
or to be the last arguments of the method.
The `call_kw` route, which is decorated by the `check` decorator,
like every route,
expands its kwargs arguments.
Therefore, once in the `check` decorator,
the context is located in the `kwargs` key
of the kwargs.
(More simply, instead of
`kwargs.get('context', {})`
it's
`kwargs.get('kwargs', {}).get('context', {})`
As the context is not retrieved correctly,
the lang is not set correctly either,
and the sql constraints were not translated.
In 7.0, it worked, because there was a double
check, as the call_kw was called trough an rpc
(`dispatch_rpc`) call,
which was decorated by the `check` as well.
As a fix for 8.0, we apply the same logic,
we perform a double check, with an indirection.
The check decorator should probably be
refactored, but this cannot be done
in a stable release such as 8.0.
Closes #3634
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function_view.xml')
0 files changed, 0 insertions, 0 deletions
