Skip to Content
Menu
This question has been flagged
2 Replies
5831 Views

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)

Avatar
Discard
Best Answer

try self._id or self.ids[0]

Avatar
Discard
Author Best Answer

hi hilari, no working this instruction


Avatar
Discard

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

Related Posts Replies Views Activity
1
Dec 23
18794
1
Mar 15
2986
0
Apr 24
396
4
Nov 23
4242
0
Oct 23
377