[FIX] website_sale: handle no partner address case
when purchasing products from website, if partner did not have a country set the "pay now" button was broken. Now you get redirected to the billing form to fill in your address.
This commit is contained in:
@@ -617,6 +617,10 @@ class WebsiteSale(http.Controller):
|
||||
if order.partner_id.id == request.website.user_id.sudo().partner_id.id:
|
||||
return request.redirect('/shop/address')
|
||||
|
||||
for f in self._get_mandatory_billing_fields():
|
||||
if not order.partner_id[f]:
|
||||
return request.redirect('/shop/address?partner_id=%d' % order.partner_id.id)
|
||||
|
||||
values = self.checkout_values(**post)
|
||||
|
||||
# Avoid useless rendering if called in ajax
|
||||
|
||||
Reference in New Issue
Block a user