[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
This commit is contained in:
Christophe Matthieu
2017-06-21 09:30:12 +02:00
parent 2bf5d1ab0c
commit 8df0a2a98e
+4 -3
View File
@@ -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):