多对多筛选
-
把assign to的字段设置成related字段关联到
discipline.engineer就可以了,比如:assign_to = fields.Many2many(related='discipline.engineer', readonly=True) -
把assign to的字段设置成related字段关联到
discipline.engineer就可以了,比如:assign_to = fields.Many2many(related='discipline.engineer', readonly=True)@digitalsatori 非常感谢您的回复,需求是不能用 related ,只能选2号中的 engineer 的值,有方法吗
-
@digitalsatori 非常感谢您的回复,需求是不能用 related ,只能选2号中的 engineer 的值,有方法吗
-
把assign to的字段设置成related字段关联到
discipline.engineer就可以了,比如:assign_to = fields.Many2many(related='discipline.engineer', readonly=True)@digitalsatori
1号 assign_to = Manyd2many('res.users', domain="[('id', 'in', discipline_id.engineer_ids)]")
2号 engineer_ids = fields.Many2many('res.users', string='Engineers')
就会报这个错

-
供你参考:
@api.onchange('discipline') def _onchange_discipline(self): return { 'domain': {'assignedTo': [('id', 'in', self.discipline.engineers.id)]}, }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login
