I am trying to add record rule:
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.model
def _search(self, args, offset=0, limit=None, order=None, access_rights_uid=None):
if not self.env.user.has_group('hat_sales_updates.part_restrict_group'):
args = [('team_id', '=', self.env.user.sale_team_id.id)] + args
else:
args = [(1, '=', 1)] + args
return super(ResPartner, self)._search(args, offset=offset, limit=limit, order=order,
access_rights_uid=access_rights_uid)
but the error ocures:
maximum recursion depth exceeded while calling a Python object
in odoo17
in xml user access error occures: