问题:代码如下,如果self.user_id = self.product_template_id.owner_dfs这个没有取到值,后面的domain就不起作用的,什么原因呢?
@api.onchange('action_id')
def _onchange_action_id(self):
dfs_group_id = self.env.ref('sps_base.group_dfs_user')
if self.action_id and self.action_id.type == "dfs":
self.user_id = self.product_template_id.owner_dfs
return {
'domain': {
'user_id': [('id', 'in', [x.id for x in dfs_group_id.mapped('users')])]
}
}