code python:
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)
return at
else:
ids_biens=self.env['gmat.journaleline'].search([('rapJor_ids','=',self.id)])
for item in ids_biens:
at.append(item.bien_id.id)
return at
user_filter = fields.Many2one('gmat.nbien',domain=[('id','in',default_domain_users)])
message ERROR:
Traceback (most recent call last):
File "/opt/odoo/openerp/http.py", line 544, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/openerp/http.py", line 595, in dispatch
return self._json_response(result)
File "/opt/odoo/openerp/http.py", line 533, in _json_response
body = simplejson.dumps(response)
File "/usr/local/lib/python2.7/dist-packages/simplejson/__init__.py", line 366, in dumps
return _default_encoder.encode(obj)
File "/usr/local/lib/python2.7/dist-packages/simplejson/encoder.py", line 269, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python2.7/dist-packages/simplejson/encoder.py", line 348, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python2.7/dist-packages/simplejson/encoder.py", line 246, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <function default_domain_users at 0x7fcfb6570aa0> is not JSON serializable