From 048539732d23bd6e53b8aa101b5d818d9e1e18b5 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 22 Mar 2018 11:14:21 +0100 Subject: [PATCH 1/2] [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) From fb2df13ea8b222e1f3ce1a5edbc316589fb7db12 Mon Sep 17 00:00:00 2001 From: Hetashree Chauhan Date: Fri, 9 Mar 2018 16:10:29 +0530 Subject: [PATCH 2/2] [FIX] stock: picking button in valuation report When hitting the picking button in the valuation report, there was a "form view could not be loaded" error. This is because we try to open a picking with a stock move id. master bug 1817491 Fixes #17226 --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 2cd17da87ed..c5f8e54d984 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -997,7 +997,7 @@ class StockMove(models.Model): 'views': [(view.id, 'form')], 'view_id': view.id, 'target': 'new', - 'res_id': self.id} + 'res_id': self.picking_id.id} show_picking = action_show_picking # Quants management