Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1236 Vistas

How to restrict visibility of customers & contacts for sales persons to only their own? in odoo 15 community edition

Avatar
Descartar
Mejor respuesta

Hello KOSMOS MANALU,

Please find below code it may help you to resolve this issue,

Please find code in comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Descartar

class ResPartner(models.Model):
_inherit = "res.partner"

@api.model
def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None):
if self.env.user.has_group('group_name_here'):
domain += [('user_id', '=', self.env.user.id)]
return super(ResPartner, self).search_read(domain=domain, fields=fields, offset=offset, limit=limit, order=order)