[FIX] website_sale: Creating an account on the eCommerce

Steps to reproduce the bug:

- Go to Settings > General Settings
- Set "Customer Account" on "Free sign up"
- Go to Website > configuration
- Activate "Digital Content"
- Create a fiscal position FP with a coutry group CG and applied automatically
- Create a service product P with digital content DC at sales price = 0
- Publish P on the website
_ Log out and go to the shop with public user
- Add P in your cart
- Process the your Order in the shop
- When the order is confirmed, click on "Downloads"
- You will be redirected to the login page
- Click on "Don't have an account?"
- Fill in the form and sign up

Bug:

Nothing happened because in function sale_get_order in model 'website'
the partner on the confirmed SO was not the same as the new one and so
update_pricelist was set to True and a call to function _cart_update was
done on a confirmed SO. Inspired from function _cart_update in model
'sale.order'.

opw:2146902

closes odoo/odoo#43362

X-original-commit: 1f6a4e56442ba5531f87269ab032f99218fc45a2
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2020-01-15 15:26:59 +00:00
parent f08204c69c
commit ffde4c8f89
+2 -1
View File
@@ -328,7 +328,8 @@ class Website(models.Model):
# check if the fiscal position has changed with the partner_id update
recent_fiscal_position = sale_order.fiscal_position_id.id
if flag_pricelist or recent_fiscal_position != fiscal_position:
# when buying a free product with public user and trying to log in, SO state is not draft
if (flag_pricelist or recent_fiscal_position != fiscal_position) and sale_order.state == 'draft':
update_pricelist = True
if code and code != sale_order.pricelist_id.code: