I created a group names Suva Sales and i want this group of users to have read access only at CRM "Won stage".
I tried record rules [('stage_id.name','!=',Won')] and also tried [["stage_id","=",4]] but could not solve it.
Any help here.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I created a group names Suva Sales and i want this group of users to have read access only at CRM "Won stage".
I tried record rules [('stage_id.name','!=',Won')] and also tried [["stage_id","=",4]] but could not solve it.
Any help here.
Hello, Rishal Chand, you can try the following code in which you need to inherit search_read method:
class CRMLead(models.Model):
_inherit = "crm.lead"
@api.model
def search_read(self, domain=None, fields=None, offset=0,limit=None, order=None):
if self.user_has_groups('your_group_name'):
domain += [('stage_id.name', '=', 'Won')]
res = super(CRMLead, self).search_read(domain, fields, offset, limit, order)
return res
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up