Skip to Content
Menu
This question has been flagged
3716 Views


This is my field

user_id = fields.Char(default = lambda self: self.env.user.id) # logged in user id
login_user_res_id = fields.Many2one('resource.resource', compute="get_login_user_resource") # resource id i want from resource table corresponding to above user_id

here is the method

@api.multi
def login_user_res_id(self):
for line in self:
value = line.user_id.resource_id
line.update({
'login_user_res_id' : value
})


This is result <bound method cash.advance.login_user_res_id of cash.advance(1,)>


please guide me whats wrong

Avatar
Discard

Hi Ayesha,

Just going through your code it seems that you are writing value to a field(by computing, field- login_user_res_id), based on that field itself.

self.login_user_res_id = self.login_user_res_id.resource_id.id.

Author

this is because it is having default loged in user id in it and i want resource id on basis of loged in user id

Author

now i have updated it still result is same