odoo/addons/web
Denis Ledoux bd9cbdfc41 [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
2015-09-04 12:58:00 +02:00
..
controllers [FIX] web: sql constraint translation 2015-09-04 12:58:00 +02:00
doc [FIX] Use local copies of png instead of fetching them from websites 2015-01-23 11:23:04 +01:00
i18n [I18N] Update translation terms from Transifex 2015-08-30 01:51:03 +02:00
static [MERGE] forward port of branch saas-3 up to 1783a7d 2015-08-27 18:01:52 +02:00
tests [FIX] web: re-enable test_menu.py without the mock-menu test 2014-10-10 18:12:59 +02:00
views [FIX] web: do not crash when select wrong db 2015-06-09 15:05:57 +02:00
.bowerrc [IMP] now uses bower for some libs 2013-07-31 15:17:31 +02:00
Gruntfile.js [IMP] Added compass compilation to grunt file 2013-07-31 12:20:37 +02:00
__init__.py [FIX] web: no need to initialize wsgi handler in postload anymore 2014-03-24 10:30:38 +01:00
__openerp__.py [MERGE] Forward-port latest saas-3 bugfixes, up to c9b690f6b6 2015-01-29 13:54:13 +01:00
bower.json bowered qweb 2013-07-31 15:55:31 +02:00
package.json [IMP] Added compass compilation to grunt file 2013-07-31 12:20:37 +02:00