[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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user