From 63a98846b188f2a1efc5af9cc5be233565c8c8ab Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Wed, 27 Jun 2018 15:55:17 +0200 Subject: [PATCH] [FIX] stock: quant_package unpack When you unpack a quant package, you have to invalidate the reservation on the move lines reserved on this package and then remove the quants from it. We need to do it as sudo because, no one has rights on quants. --- addons/stock/models/stock_quant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index 4f42602c023..08e424cfe52 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -386,7 +386,7 @@ class QuantPackage(models.Model): ('product_qty', '!=', 0), ]) move_line_to_modify.write({'package_id': False}) - package.mapped('quant_ids').write({'package_id': False}) + package.mapped('quant_ids').sudo().write({'package_id': False}) def action_view_picking(self): action = self.env.ref('stock.action_picking_tree_all').read()[0]