From 97a83b06154af0701578728277b55bec95e641a0 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 29 Jan 2020 22:37:36 +0100 Subject: [PATCH] stock_usability: Add compute_sudo=True on some related fields of stock.inventory.line to avoid ACL issues --- stock_usability/stock.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stock_usability/stock.py b/stock_usability/stock.py index c8f4146..4765d36 100644 --- a/stock_usability/stock.py +++ b/stock_usability/stock.py @@ -22,15 +22,17 @@ class StockInventoryLine(models.Model): related='inventory_id.date', readonly=True) partner_id = fields.Many2one(states={'done': [('readonly', True)]}) product_id = fields.Many2one(states={'done': [('readonly', True)]}) - product_code = fields.Char(readonly=True) + product_code = fields.Char(readonly=True, compute_sudo=True) product_uom_id = fields.Many2one(states={'done': [('readonly', True)]}) product_qty = fields.Float(states={'done': [('readonly', True)]}) location_id = fields.Many2one(states={'done': [('readonly', True)]}) - location_name = fields.Char(readonly=True) + location_name = fields.Char(readonly=True, compute_sudo=True) package_id = fields.Many2one(states={'done': [('readonly', True)]}) prod_lot_id = fields.Many2one(states={'done': [('readonly', True)]}) state = fields.Selection(store=True) inventory_location_id = fields.Many2one(readonly=True) + product_name = fields.Char(compute_sudo=True) + prodlot_name = fields.Char(compute_sudo=True) class StockPicking(models.Model):