[FIX] website_sale: do not request shipping address when already given

* if customer said to use the same address as shipping
* if customer already chose/has/gave shipping address

Part-of: odoo/odoo#139474
This commit is contained in:
Victor Feyens
2023-10-24 13:55:25 +00:00
parent e18f6b8f5a
commit 7a1f505e31
+6 -2
View File
@@ -1293,9 +1293,13 @@ class WebsiteSale(payment_portal.PaymentPortal):
update_values['partner_invoice_id'] = partner_id
if kw.get('use_same'):
update_values['partner_shipping_id'] = partner_id
elif not kw.get('callback') and not order.only_services:
elif (
order._is_public_order()
and not kw.get('callback')
and not order.only_services
):
# Now that the billing is set, if shipping is necessary
# request the user to fill the shipping address
# request the customer to fill the shipping address
kw['callback'] = '/shop/address'
elif address_mode == 'shipping':
update_values['partner_shipping_id'] = partner_id