Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
一般many2one过滤数据直接用domain="[(...,op,...)]",那如何设置能使many2one('hr_employee',...)字段的下拉列表中显示的员工都是指定group内的?如想列出所有在某一审批权限组内的员工?
@wangss domain写成一个方法,如下:
@api.model def _get_users(self): user_ids = self.env.ref('sps_base.group_duser').mapped('users') return [('id', 'in', [x.id for x in user_ids])] owner = fields.Many2one('res.users', string='Owner', domain=_get_users)
谢谢:thumbs_up: