You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[FIX] website_sale: prevent error when changing the delivery address
Currently, an error occurs when the user changing the delivery address in
the website.
Steps to reproduce:
- Install the website_sale module and enable the Demo payment provider.
- Go to Website > Shop > Add a product to Cart > View cart > Checkout.
- Ensure there are at least two different delivery addresses > Confirm > Pay now.
- Quickly press the browser’s back button twice.
- Select a different delivery address.
Error:
ValueError: Expected singleton: sale.order()
Root Cause:
At [1], the code calls order.ensure_one(). When the cart (sale.order) is empty,
leads to an error.
Fix:
This commit prevents a traceback on the frontend when a user attempts to
change the delivery address and safely redirects them to the shop page.
[1]:
https://github.com/odoo/odoo/blob/88c9a45ee1ff8dde871865723c3387c059af8289/addons/delivery/models/delivery_carrier.py#L157
sentry-6869972801
closesodoo#233326
X-original-commit: 2b57313
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
Signed-off-by: Utsav Maru (utma) <utma@odoo.com>
0 commit comments