[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
This commit is contained in:
Cedric Snauwaert
2015-12-07 17:38:23 +01:00
parent 1f51a7073d
commit 6f0b224e5f
+1 -1
View File
@@ -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