From 0d16d65eb463e909280e398e5ec6b3b5997918cb Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Tue, 4 Sep 2018 11:50:02 +0200 Subject: [PATCH] [FIX] sale: access right for name_get of SOL Sometimes, we want to give access to sale lines only for some users. But to allow them to read a SOL, they need the read access of the sale order (as the name is part of the name_get of SOL), which might break the saleperson rights. This commit makes the name_get of sOL as to allow fetching the name of SOL without having the access right on the order. --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index a6143ef1d93..c24ffbecb37 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -1387,7 +1387,7 @@ class SaleOrderLine(models.Model): @api.multi def name_get(self): result = [] - for so_line in self: + for so_line in self.sudo(): name = '%s - %s' % (so_line.order_id.name, so_line.name.split('\n')[0] or so_line.product_id.name) if so_line.order_partner_id.ref: name = '%s (%s)' % (name, so_line.order_partner_id.ref)