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)