From c0307f37d2999898cd7bde926702e6945ade6c69 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 2 Jul 2014 19:20:30 +0200 Subject: [PATCH] FIX --- addons/website_sale/controllers/main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 00c314f4ed8..e56e3bb1478 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -280,10 +280,12 @@ class website_sale(http.Controller): def cart(self, **post): cr, uid, context, pool = request.cr, request.uid, request.context, request.registry order = request.website.sale_get_order() - - from_currency = pool.get('product.price.type')._get_field_currency(cr, uid, 'list_price', context) - to_currency = order.pricelist_id.currency_id - compute_currency = lambda price: pool['res.currency']._compute(cr, uid, from_currency, to_currency, price, context=context) + if order: + from_currency = pool.get('product.price.type')._get_field_currency(cr, uid, 'list_price', context) + to_currency = order.pricelist_id.currency_id + compute_currency = lambda price: pool['res.currency']._compute(cr, uid, from_currency, to_currency, price, context=context) + else: + compute_currency = lambda price: price values = { 'order': order,