[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:
Denis Vermylen (dve)
2016-08-31 17:17:38 +02:00
parent c255342e8f
commit 6eca5d038f
+4
View File
@@ -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