From 8df0a2a98eca638c62c9b71297712a496c180698 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 21 Jun 2017 09:25:15 +0200 Subject: [PATCH] [FIX] stock: stock manager can have an access error to stock location If the user change the access right to filter some stock location or multi company, the user can have an access error to read stock pack operation. opw-747526 --- addons/stock/models/stock_pack_operation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/stock/models/stock_pack_operation.py b/addons/stock/models/stock_pack_operation.py index 609898a4380..738e2dd384d 100644 --- a/addons/stock/models/stock_pack_operation.py +++ b/addons/stock/models/stock_pack_operation.py @@ -110,10 +110,11 @@ class PackOperation(models.Model): qty -= record.qty self.remaining_qty = float_round(qty, precision_rounding=self.product_id.uom_id.rounding) - @api.one + @api.multi def _compute_location_description(self): - self.from_loc = '%s%s' % (self.location_id.name, self.product_id and self.package_id.name or '') - self.to_loc = '%s%s' % (self.location_dest_id.name, self.result_package_id.name or '') + for operation, operation_sudo in zip(self, self.sudo()): + self.from_loc = '%s%s' % (operation_sudo.location_id.name, self.product_id and operation_sudo.package_id.name or '') + self.to_loc = '%s%s' % (operation_sudo.location_dest_id.name, operation_sudo.result_package_id.name or '') @api.one def _compute_lots_visible(self):