Skip to content
Snippets Groups Projects
Commit e5a76880 authored by Manuel Gómez - https://www.vauxoo.com/'s avatar Manuel Gómez - https://www.vauxoo.com/ Committed by imanie383
Browse files

[FIX] website_sale: the pricelist is reset when the address is edited


Expected behavior : The pricelist must be the one chosen by the customer on the website.

Current behavior : The price list is reset when the address is edited

Steps to reproduce the error :
First of all, you need to setup 2 pricelists on the website:
~ The first in dollars
~ The second in euros
~ Removes the group of countries from both

1. Create an order with the second price list (EURO)
2. Set your address
3. Edit your address
4. The pricelist will be changed to dollars

When you set the address for the first time, It redirects to /shop/confirm_order which
executes sale_get_order(update_pricelist=True) to correct the price list.

But when you edit the address sale_get_order(update_pricelist=True) is not  executed

closes odoo/odoo#83061

closes odoo/odoo#83121

Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
parent 8c4d6d36
No related branches found
No related tags found
No related merge requests found
......@@ -728,6 +728,10 @@ class WebsiteSale(http.Controller):
if not kw.get('use_same'):
kw['callback'] = kw.get('callback') or \
(not order.only_services and (mode[0] == 'edit' and '/shop/checkout' or '/shop/address'))
# We need to update the pricelist(by the one selected by the customer), because onchange_partner reset it
# We only need to update the pricelist when it is not redirected to /confirm_order
if kw.get('callback', '') != '/shop/confirm_order':
request.website.sale_get_order(update_pricelist=True)
elif mode[1] == 'shipping':
order.partner_shipping_id = partner_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment