[FIX] website_sale: modify template if fiscal position changes
Steps to reproduce:
-------------------
- Without going to the shop first, login with a user
who triggers a different fiscal position and pricelist than the public user.
- In another browser tab (incognito or separate tab),
go to the shop with the public user.
- Select the pricelist previously used
by the user in the other session.
Issue:
------
We obtain the prices for the other user's fiscal position.
Cause:
------
When we login with a user who triggers a fiscal position mapping
and go to the `/shop` page, `products_prices` will be frozen with values
calculated with the fiscal position (via `_get_sales_prices`).
If we change our fiscal position, but use a template that contains
the same `t-cache` key, we won't re-evaluate the template.
As a result, it is possible to obtain values calculated
for another fiscal position.
Solution:
---------
As the template values take into account the fiscal position,
we need to add a `t-cache` key to identify this fiscal position.
opw-3316153
closes odoo/odoo#133949
Signed-off-by:
Thomas Lefebvre (thle) <thle@odoo.com>
Showing
- addons/website_sale/controllers/main.py 3 additions, 0 deletionsaddons/website_sale/controllers/main.py
- addons/website_sale/static/tests/tours/website_sale_fiscal_position_tour.js 37 additions, 0 deletions...e/static/tests/tours/website_sale_fiscal_position_tour.js
- addons/website_sale/tests/__init__.py 1 addition, 0 deletionsaddons/website_sale/tests/__init__.py
- addons/website_sale/tests/test_website_sale_fiscal_position.py 88 additions, 0 deletions...s/website_sale/tests/test_website_sale_fiscal_position.py
- addons/website_sale/views/templates.xml 7 additions, 0 deletionsaddons/website_sale/views/templates.xml
Loading
Please register or sign in to comment