[FIX] website_sale: frontend billing address is partner's address

Have a partner

Partner (A1)
/		\
Shipping Addr (A2)	Invoice Addr (A3)

Give portal access to A1
Make a webshop order with A1

Make it possible for the front end user to edit his billing address (by having forgotten "country" on A1)
Note that the address being choosen as Billing is A1, NOT A3
Save
In the backend check the order. The customer is A1
The shipping address is A2

Before this commit though, the invoice address is A3, which is plain wrong
usability-wise since at no point in the flow the front end user chose that address

After this commit, the billing address stays A1, and A3 is just ignored

This goes with the spirit of https://github.com/odoo/odoo/commit/6e69de67071f2618e00856a74716d861b7f47391
Also, something smarter is possible if we let the user choose the billing address
just like we let him choose the shipping address

OPW 2034976

closes odoo/odoo#35105

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
Lucas Perais (lpe)
2019-07-23 12:32:48 +00:00
parent 7273719b88
commit a5ca064dc2
+2
View File
@@ -681,6 +681,8 @@ class WebsiteSale(ProductConfiguratorController):
if mode[1] == 'billing':
order.partner_id = partner_id
order.onchange_partner_id()
# This is the *only* thing that the front end user will see/edit anyway when choosing billing address
order.partner_invoice_id = partner_id
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'))