*: website_sale_stock
When translations are loaded in a front-end page, the language is
initially deduced by the server. The `GET` that obtains them does not
have a language parameter set. Because of this, this initial result is
reused from the browser cache on subsequent page accesses.
This is a problem when the user toggles between languages because the
cached content is reused while it is related to a previously selected
language.
This commit avoids this problem by making the cache specific to the
current front-end language.
Steps to reproduce:
- Make sure "Disable cache" is not enabled in your browser.
- Install website_sale_stock.
- Add the French language and activate it on the first website.
- In the backend, go to a product (e.g. Office Lamp)'s Sales tab.
- Disable "Out-of-Stock: Continue selling".
- Enter an "Out-of-Stock Message" in both English and French.
- Open the product's website page in French.
- Copy the URL.
- Open a new browser private navigation window.
- Go to the copied URL.
- Switch to English.
- Switch to French.
=> The price is first displayed correctly in French with a "," decimal
separator then is replaced by using the English "." decimal separator
and the out-of-stock message is displayed in English.
opw-3293403
opw-3343614
closesodoo/odoo#124907
X-original-commit: a827de6fffedc9d952d0a4e888c7089896bdb44f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>