[FIX] website_sale: recompute fiscal position

Following commit 6006c0d72a, the shipping address can be changed after
the call to `checkout_form_save`. This is the case, for example, when
the user has the same shipping and invoicing address. We need to make
sure to recompute the fiscal position after the shipping address is
finally set.

opw-689281
This commit is contained in:
Nicolas Martinelli
2016-09-30 11:52:51 +02:00
parent 204c75939a
commit b2b85fbb19
+3 -3
View File
@@ -644,9 +644,6 @@ class website_sale(http.Controller):
if checkout.get('shipping_id'):
order.write({'partner_shipping_id': checkout['shipping_id']})
order_obj.onchange_partner_shipping_id(cr, SUPERUSER_ID, [order.id], context=context)
order.order_line._compute_tax_id()
order_info = {
'message_partner_ids': [(4, partner_id), (3, request.website.partner_id.id)],
}
@@ -689,6 +686,9 @@ class website_sale(http.Controller):
if not int(post.get('shipping_id', 0)):
order.partner_shipping_id = order.partner_invoice_id
order.onchange_partner_shipping_id()
order.order_line._compute_tax_id()
request.session['sale_last_order_id'] = order.id
request.website.sale_get_order(update_pricelist=True, context=context)