跳至內容
選單
此問題已被標幟
2 回覆
6957 瀏覽次數

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
20317
1
3月 15
3825
0
4月 24
1878
4
11月 23
6002
0
10月 23
1751