From 048539732d23bd6e53b8aa101b5d818d9e1e18b5 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 22 Mar 2018 11:14:21 +0100 Subject: [PATCH] [FIX] stock_account: compute price if no product - Activate anglo-saxon accounting - Create an invoice with a line without product but a UOM - Validate A traceback arises since `_compute_price` is called on an empty recorset. opw-1830042 --- addons/stock_account/models/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index 6707c437c68..bb04c02903d 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -201,8 +201,8 @@ class ProductProduct(models.Model): @api.model def _get_anglo_saxon_price_unit(self, uom=False): price = self.standard_price - if not uom or self.uom_id.id == uom.id: - return price + if not self or not uom or self.uom_id.id == uom.id: + return price or 0.0 return self.uom_id._compute_price(price, uom)