From 6f0b224e5f4b6e8362e20722e845264fda4324f7 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Mon, 7 Dec 2015 17:36:26 +0100 Subject: [PATCH] [FIX] sale_analytic: missing condition in _get_sale_order_line Problem was that if we don't have a sale_order_line, it might crash trying to compute between a currency and an empty recordset --- addons/sale/sale_analytic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale_analytic.py b/addons/sale/sale_analytic.py index 4836bdaff90..ddf24b7d1df 100644 --- a/addons/sale/sale_analytic.py +++ b/addons/sale/sale_analytic.py @@ -84,7 +84,7 @@ class AccountAnalyticLine(models.Model): limit=1) # Use the existing SO line only if the unit prices are the same, otherwise we create # a new line - if sol.price_unit == self._get_invoice_price(sol.order_id): + if sol and sol.price_unit == self._get_invoice_price(sol.order_id): result.update({'so_line': sol.id}) else: sol = self.so_line