diff options
| author | Jeremy Kersten <jke@odoo.com> | 2020-04-17 08:49:41 +0000 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2020-05-08 15:55:08 +0000 |
| commit | 23441987651865293d7847be918d2e7bcdcaf521 (patch) | |
| tree | d405a3e528be4c29490e7f67b3e70ff47d6f9b8c /addons/web/static/tests/fields | |
| parent | 4b9e14719e35090a317dc11b1326969c2cd8e80e (diff) | |
[FIX] website: compute_url should depend of the lang
With this fix, record.with_context(lang='fr').compute_url will have the url
with the slug in french.
Before, it was ignoring the lang since the field was not translatable.
The first compute was stored in cache, and next call just ignore the lang in
the context.
```py
for lang in ['en_US', 'fr_FR']:
print(record.with_context(lang=lang).website_url)
> "/my-name-1"
> "/my-name-1"
```
now
```py
for lang in ['en_US', 'fr_FR']:
print(record.with_context(lang=lang).website_url)
> "/my-name-1"
> "/mon-nom-1"
```
closes odoo/odoo#50951
X-original-commit: 43822adef4ee4c44d10786f28af46df4be260cf5
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/web/static/tests/fields')
0 files changed, 0 insertions, 0 deletions
