跳至内容
菜单
此问题已终结
2 回复
6964 查看

def default_domain_users(self):

at=[]

userx = self.env.user.login

if userx == "bendjeddou.o":

ids_biens=self.env['gmat.journaleline'].search([('exp_P','=',0),('rapJor_ids','=',self.id)])

for item in ids_biens:

at.append(item.bien_id.id)

else:

ids_biens=self.env['gmat.journaleline'].search([('rapJor_ids','=',self.id)])

for item in ids_biens:

at.append(item.bien_id.id)

return [('id','in', at)]

user_filter = fields.Many2one('gmat.nbien',domain=default_domain_users)

形象
丢弃
最佳答案

try self._id or self.ids[0]

形象
丢弃
编写者 最佳答案

hi hilari, no working this instruction


形象
丢弃

then check the self object. and from where this function is called

相关帖文 回复 查看 活动
1
12月 23
20321
1
3月 15
3829
0
4月 24
1884
4
11月 23
6013
0
10月 23
1759