İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
1234 Görünümler

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

Avatar
Vazgeç
En İyi Yanıt

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
Vazgeç

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)