Skip to Content
Menu
This question has been flagged

I am trying to filter the records based on their group id. I have write a domain filter in menu actionlike this

[('pending_approver','in',[g.id for g in user.groups_id])]

pending_approver is a Many2one field with res.groups

Have a look on this for more clarification.

def _default_approver(self):
    obj = self.env['approval_heirarchy.approval_rules'].search([('id', '=', 1)], limit=1)
if obj.x_approver_ids:
val = obj.x_approver_ids[0].x_user_ids
return obj.x_approver_ids[0].x_user_ids.id
pending_approver = fields.Many2one('res.groups', string="Pending Approver", readonly=True,default=_default_approver)

I didn't get why it always prompt an Odoo Client Error:

Uncaught Error: Expected "]", got "(name)" 

I've searched a lot but didn't find any solution. Any help will be a great regard for me. Thanks in Advance!

Avatar
Discard
Related Posts Replies Views Activity
0
Feb 25
18
2
May 25
4025
1
Jul 15
4640
1
Mar 15
3638
2
Mar 15
6773